Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Vfp Database StoreProc with Parameter
Message
From
21/09/2002 01:55:55
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00703020
Message ID:
00703027
Views:
35
Hi Rock,

Just a guess (since I've been using SqlCommand and not OleDbCommand, but I'm guessing the syntax is similar enough) ... maybe your CommandText should be without the brackets, like this:
poCmd.CommandText = "test";
~~Bonnie



>Hi Guys,
>
>I want to call a vfp store procedure with parameter and it always give me a ole exception code...
>
>Thank's for your help.
>
>That's the code i try. Do you saw something Wrong...
>
>
>OleDbConnection oCon = new OleDbConnection(@"provider=vfpoledb;data source=C:\Devellopement\Data\Video.dbc");
>			
>OleDbCommand poCmd = new OleDbCommand();
>poCmd.Connection = oCon;
>poCmd.CommandText = "[test]";
>poCmd.CommandType = CommandType.StoredProcedure;
>
>OleDbParameter x = new OleDbParameter("@psParam",OleDbType.VarChar);
>x.Value = "Salut";
>poCmd.Parameters.Add(x);
>			
>poCmd.Connection.Open();
>string y  = poCmd.ExecuteScalar().ToString();
>
>
>Vfp SP code...
>
>
>PROCEDURE Test(psParam as String) as String
>	RETURN psParam
>ENDPROC
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform