|
cavall wrote:
I have not used any behind code in this as far as binding the dataset to the datagrid, etc.
Have you add mydataadapter.Fill(dataset); in your code-behind?
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
Hi,
I'm doing ASP.NET application.
What is the type of the SqlParameter.Value to call a stored procedure expecting a nvarchar parameter?
I tried to simply use a string, but it fails (code compiles, but the stored procedure returns nothing).
I tried also to cast the string to a SqlDbType.Nvarchar, but I didn't manage.
Thanks for help, sorry if I'm not clear ...
Matthieu
|
|
|
|
|
String should work. What does the stored proc look like?
|
|
|
|
|
Hi,
The procedure:
ALTER PROCEDURE matthieu77.GetUserByName ( @Nom nvarchar )
AS
SELECT UserID, Nom
FROM Users
WHERE Nom=@Nom
RETURN
The code that calls this proc:
SqlParameter param = new SqlParameter ("@Nom",SqlDbType.NVarChar);
param.Direction=ParameterDirection.Input;
param.Value="Bonjour";
SqlDataAdapter ad = new SqlDataAdapter();
ad.SelectCommand = new SqlCommand();
ad.SelectCommand.Connection = sqlConnection1;
ad.SelectCommand.CommandText = "GetUserByName";
ad.SelectCommand.CommandType =CommandType.StoredProcedure;
ad.SelectCommand.Parameters.Add(param);
ad.Fill(dataSet11,"Users");
DataGrid1.DataBind();
If I replace in the stored procedure Nom='Bonjour' it works fine.
Regards,
Matthieu
|
|
|
|
|
I am trying to access and pull data into a datagrid from a MS Access database located on a network drive. Everytime I try and run the project I get this error:
The Microsoft Jet database engine cannot open the file '\\Jxn-nt-tmsus\e\LISTEST\e214.mdb'. It is already opened exclusively by another user, or you need permission to view its data.
I know there is no one else in the file and i have rights to access the file.
Any suggestions?
THanks very much
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
If you're talking about ASP.NET, make sure the YourMachineName\ASPNET user account has read/modify permissions on the folder containing the .mdb file.
Marcie
http://www.codeproject.com
|
|
|
|
|
Marcie,
I copied the database to my local machine and I can access the data fine.
As soon as I try to access it on the remote location... I get the error.
I do not see a user account on the Intranet domain for ASPNET... does there need to be one on that level or do I need to make sure that just myMachine/ASPNET user account can read/modify that remote folder..
Thanks!!
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
The EVERYONE account has Full Control access to the folder and file... wouldnt that include any ASPNET account that could possibly be in there?
Thanks
"Nothing is at last sacred, but the integrity of your own mind."
"What lies behind us and what lies before us are nothing compared to what lies within us." - Ralph Waldo Emerson
|
|
|
|
|
I'm doing some test with sql connection polling using sqlconnection object.
I've read some articles stating that the Dispose method of the connection removes the connection from the pool, but in my tests the Dispose doesn't remove it from the pool (I'm checking the audit logout event in the SQL Trace). The audit logout only happens when I close the application.
My question is... does the dispose method remove the connection from the pool or not !?
|
|
|
|
|
|
I'm using the connection timeout parameter of the connection string. The problem is that its not respecting the parameter i'm passing.
Ex.: Data Source=DummyInexistantServer;Initial Catalog=Zombo; Integrated Security=SSPI;Connection Timeout=5;
Since the server doesn't exists it should return an error in 5 seconds (according to the connect timeout paramtere). The fact is... its taking about 30 seconds to throw me the error.
any ideas ?
Mauricio Ritter - Brazil
Sonorking now: 100.13560 MRitter
English is not my native language so, if you find any spelling erros in my posts, please let me know.
|
|
|
|
|
when i execute my stored procedure in asp.net...i had this server error 'Exception Details: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.'
wat does this error message mean and how can i retify it. for info this is my stored procedure... how can my codes be amended to solve this prob..or is it my codes in my aspx.vb tat is the cause of the prob??
CREATE proc spAddRegCust(@custName varchar(50), @custTitle varchar(5), @custGender varchar(6), @custICNo varchar(9),
@custDOB datetime, @resiAdd varchar(50), @custPhone varchar(8), @custEMail varchar(50),
@billAdd varchar(50), @deliAdd varchar(50), @custLoginID varchar(10), @custPwd varchar(10), @custConfirmPwd varchar(10),
@custJoinDate datetime)
AS
IF @custName is NULL
BEGIN
RETURN -201
END
if EXISTS (SELECT custLoginID FROM Customers Where custName=@custName)
BEGIN
RETURN -200
END
insert into Customers(custName, custTitle, custGender, custICNo,custDOB,resiAdd,custPhone,custEMail,
billAdd, deliAdd, custLoginID, custPwd, custConfirmPwd,custJoinDate)
values(@custName,@custTitle, @custGender, @custICNo, @custDOB, @resiAdd, @custPhone, @custEMail,
@billAdd, @deliAdd, @custLoginID, @custPwd, @custConfirmPwd,@custJoinDate)
return
GO
|
|
|
|
|
It's not the SQL that is causing your error. Check the String.Format that you are using, you probably don't have the numer of params correct, or are trying to access more that you have.
String.Format("{0}{1}", param1);<br />
String.Format("{2}", param1);<br />
These will cause the error.
|
|
|
|
|
Hi There,
I used odbc Driver for .Net to Read Records from .dbf Data file, everything is fine but some fields I have problem retrieving the data with simple select statment. Even SQL Server 2000 can not import those feilds. The only way for me to see the data is to use dbf viewer which can not help me with my project.
The data type is Numeric, Size:6, Dec:3 (from the dbf viewer)
and the Data has a decimal point ex. 13.060 or 4.080
any body had thes
Mabb
|
|
|
|
|
maybe read it as a text value and convert it in the app
"there is no spoon" biz stuff about me
|
|
|
|
|
Hello
i'm writing my first database app using mfc/odbc. I have created DSN with paradox tables (microsoft paradox driver). And the problem is that when i create table in win9x it won't work in winxp. In my mfc app i get an error saying that the table have not appropriate format. i have installed different versions of mdac (2.8, 2.7) on win9x/xp and it isn't working. when i create table in winxp it works fine on both systems. but usually people are moving from win9x --> xp.
Could someone tell me what i'm doing wrong?
thanks
Chris
|
|
|
|
|
Microsoft says "Starting with version 2.6, MDAC no longer contains Jet components. In other words, MDAC 2.6, 2.7, and all future MDAC releases do not contain Microsoft Jet, Microsoft Jet OLE DB Provider, or the ODBC Desktop Database Drivers. No new feature enhancements will be made to Jet."
What's happening is you're probably having Paradox ODBC driver differences between Windows 98 and XP, possibly stemming from use of Unicode, or many other factors. If it's working in the XP to 98 direction, just create your tables on XP and distribute them to the downlevel Win98 clients.
FYI. Microsoft ended OEM retail license availability of WinME on December 31, 2003; Win98 (all versions) on June 30, 2002; Win95 on December 31, 2000 and Win3.x and below (yes there was a 1.x and 2.x) on 31-Dec-2001. Win2k Pro will end OEM retail license availability on March 31, 2004. NT 4 Workstation ended June 30, 2002.
NT 4 Service pack updates: No further updates planned.
|
|
|
|
|
Hi, Folks!
In my applications I build an insert statement by concatenating several strings together, adding values by first using sprintf to get a string of the value. These values are defined in my database as floats, so all this conversation results in a loss of precision.
I believe the right way to do this is to bind my application's variables to the connection. However, the only call I've come across to do this with is SQLBindParameter. The problem I have is this: the call needs to know the parameter's ordinal position in the database schema. In my apps I don't always know this; I only know the column names.
So, it boils down to this: is there a way to get a column's parameter number from its name?
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
Jesse Evans wrote:
The problem I have is this: the call needs to know the parameter's ordinal position in the database schema. In my apps I don't always know this; I only know the column names
I think you might be incorrect here. It's not the ordinal position in the database schema, but rather the ordinal position within the SQL statement you are binding to.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Chris Meech wrote:
It's not the ordinal position in the database schema
<grok=true>
Ah, I get it now! Thanks, Chris!
'til next we type...
HAVE FUN!! -- Jesse
|
|
|
|
|
Hi,
How to find the records which contain '%' or '_' in a oracle table?
Thanks in advance.
|
|
|
|
|
You should search for Wildcard Charactersvin its help.
Mazy
"Man is different from animals in that he speculates, a high risk activity." - Edward Hoagland
|
|
|
|
|
I am trying to convert a native DB to MS SQL server. When I want to acces a specific collumn the output contains only fuzzy characters. So I tried to cast the datatype to an integer type. This does not work. The only thing I know is that the datatype of the native DB is DBTYPE_STR.
Who can help me convert this datatype to an integer value?
Robert Smit
|
|
|
|
|
i have problem during my project ........
i want to convert the procedures of pl/sql into T-sql
i am converting the procedures of oracle into sql server
using vb.net kindly someone help me out.
best of luck
|
|
|
|
|
"best of luck" is about right.
You need a good book on T-SQL and/or PL/SQL, depending on how well you know one of them to start with.
Where I work we support ORACLE 9i and SQL Server 7 (and later), so when we use stored procedures, we have to write them twice (and make sure they are compatible in terms of parameters etc).
Steve S
|
|
|
|