Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFPOLEDB and Parameters
Message
From
29/06/2004 19:46:28
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00918644
Message ID:
00918788
Views:
9
Dmitry,

>(as the song goes, "you know more than I will ever know" <g>.

Well, I don't think I'd go quite that far! <g>

>I didn't want Dan to look in "that" (@ vs ?) direction as it must be something else causing his problem.

And, it looks like you were right, because he's still got the problem. =(

~~Bonnie





>I was not trying to correct you (as the song goes, "you know more than I will ever know" <g>. I didn't want Dan to look in "that" (@ vs ?) direction as it must be something else causing his problem.
>
>>OK, Dmitry ... it was just a guess ... I saw some code posted here before that used the "?" for the VFPOLEDB provider, so I thought maybe that was the problem.
>>
>>~~Bonnie
>>
>>
>>>Bonnie,
>>
>>>
>>>I use OleDb too. And I have used the syntax .Add("@CustomerID","Value") many times.
>>>
>>>>Dan,
>>>>
>>>>I'm not 100% sure (since I'm not using the VFPOLEDB provider), but I think the "@" sign, as Dmitry suggested, is for SQL. I think you need to use the "?" for OleDB. Try this instead:
>>>>
>>>>OleDbCommand objCmd = new OleDbCommand("select * from customers where CustomerID = ?");
>>>>objCmd.Parameters.Add("?CustomerID", "ALFKI");
>>>>
>>>>
>>>>~~Bonnie
>>>>
>>>>
>>>>>I'm using the VFPOLEDB provider and I am creating a command object like this:
>>>>>
>>>>>
>>>>>OleDbCommand objCmd = new OleDbCommand("select * from customers where CustomerID = ?");
>>>>>objCmd.Parameters.Add("CustomerID", "ALFKI");
>>>>>
>>>>>
>>>>>When I execute this command I am getting an OleDbException that says:
>>>>>
>>>>>
>>>>>No value given for one or more required parameters.
>>>>>
>>>>>
>>>>>How do I use the parameter collection to pass parementers to commands?
Bonnie Berent DeWitt
NET/C# MVP since 2003

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

Click here to load this message in the networking platform