Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OleDb Parameters
Message
De
27/09/2004 09:55:44
 
 
À
27/09/2004 07:28:22
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00946213
Message ID:
00946235
Vues:
17
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform