Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calling VFP Stored Procedure ?
Message
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00712424
Message ID:
00742110
Views:
38
OK, count me in as waiting with baited breath. :)

>Steve,
>
>This functionality was not yet implemented in the public beta. You will need to wait for the final release to use these settings. To work around this, you can use CommandText and call the stored procedure with the parameters in the text itself.
>
>>I'm back again, this time with the driver that comes with VFP8-beta.
>>
>>I still can't seem to pass parameters and set the command type to StoredProcedure.
>>
>>Have you had any luck?
>>
>>
>>string returnVal = "!unknown";
>>try
>>{
>>	dataConn.Open();
>>}
>>catch (System.Data.DataException xxx)
>>{
>>	returnVal = xxx.ToString();
>>}
>>OleDbCommand dataCmd = new OleDbCommand("_spDirAccessReadVerify",dataConn);
>>dataCmd.CommandType = CommandType.StoredProcedure;
>>dataCmd.Parameters.Add(new OleDbParameter("dirName",OleDbType.Char,239,"dirName"));
>>dataCmd.Parameters.Add(new OleDbParameter("groupName",OleDbType.Char,239,"groupName"));
>>dataCmd.Parameters[0].Value = "a";
>>dataCmd.Parameters[1].Value = "b";
>>Console.WriteLine(dataCmd.Parameters.Count); // shows "2"	
>>returnVal = dataCmd.ExecuteScalar().ToString();
>>
>>
>>My VFP stored procedure named _spDirAccessReadVerify takes two string parameters. The error I get is
>>
>>
>>Unhandled Exception: System.Data.OleDb.OleDbException: Unrecognized command verb.
>>
>>
>>Which is what I get when I just type "_spDirAccessReadVerify" in the VFP8 command window. If I am in the command window and type _spDirAccessReadVerify ("a","b") then I get my expected result.
>>
>>It's like the OLEDB provider is not taking in the command with the parms, it's taking the command only and choking.
>>
>>What do you think?
>>
>>Thanks.
>>
>>>The good news is that when the release is made, it will also work for VFP7.
>>>
>>>>Ouch. I was afraid you were going to say that. :)
>>>>
>>>>I was hoping I could put my "anti-SQL-injection-attack" code in the VFP SP, and I could also make my C# code that talks to VFP 99% like what I use to talk to MSSQL.
>>>>
>>>>Do you know if the next iteration of the OLEDB driver will come out as a patch to VFP7 as originally slated for last July, or is it locked with the release of VFP8?
>>>>
>>>>Thanks for all the help!
Previous
Reply
Map
View

Click here to load this message in the networking platform