Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Parameters with the VFPOLEDB provider?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00833708
Message ID:
00833711
Vues:
25
You can definately do that. This is from the top of my head, but I think you just use the ? alone in the command text, but use the ?groupName in the parameter. Just make sure to keep the parameters in order.
System.Data.OleDb.OleDbCommand SaveGroupCommand = new OleDbCommand(
				"UPDATE GROUPDETAILS SET GROUPNAME = ? WHERE GROUPDETAILS.GROUPID = ? ", dbConnection);

SaveGroupCommand.Parameters.Add("?groupName", "Did it save");
SaveGroupCommand.Parameters.Add("?groupId", this.GroupId);
SaveGroupCommand.ExecuteNonQuery();
>Is it possible to use parameters in INSERT and UPDATE commands with the VFP OLEDB Provider in .net (or any environment really?)
>
>I have the following code:
>
>
>System.Data.OleDb.OleDbCommand SaveGroupCommand = new OleDbCommand(
>				"UPDATE GROUPDETAILS SET GROUPNAME = @groupName WHERE GROUPDETAILS.GROUPID = " + this.GroupId.ToString(), dbConnection);
>
>SaveGroupCommand.Parameters.Add("@groupName", "Did it save");
>
>SaveGroupCommand.ExecuteNonQuery();
>
>
>But it fails with a syntax error, I have also tried using a "?" instead of the "@" and it is the same.
>
>Is it possible to use parameters?
Bill Mittenzwey
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform