Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OleDb Parameters
Message
From
27/09/2004 09:55:44
 
 
To
27/09/2004 07:28:22
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00946213
Message ID:
00946235
Views:
19
I think you need to use a "?" in your Select Command instead of an "@".
String selectCmd = "select * from paperoll where supNo = ?supNo";
Everything else should be ok the way you have it.

~~Bonnie

>How can I using parameters to select data subset of data from VFP table.
>
>I try using following code, but can't work for me.
>
>Thanks.
>
>
>-------------------
>String selectCmd = "select * from paperoll where supNo = @supNo";
>
>OleDbDataAdapter daPaper = new OleDbDataAdapter(selectCmd, oleDbConnection1);
>
>daPaper.SelectCommand.Parameters.Add(new OleDbParameter("@supNo",OleDbType.Char,5));
>
>daPaper.SelectCommand.Parameters["@supNo"].Value = mySelect.Value;
>
>DataSet dsPaper = new DataSet();
>daPaper.Fill(dsPaper, "paperoll");
>
>DataGrid1.DataSource= dsPaper.Tables["paperoll"].DefaultView;
>DataGrid1.DataBind();
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