Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Parameters with the VFPOLEDB provider?
Message
De
01/10/2003 04:23:01
 
 
À
01/10/2003 00:25:25
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Divers
Thread ID:
00833708
Message ID:
00833731
Vues:
28
Hi,

>Is it possible to use parameters in INSERT and UPDATE commands with the VFP OLEDB Provider in .net (or any environment really?)

VFPOLEDB doesn't support named parameters. Try:
System.Data.OleDb.OleDbCommand SaveGroupCommand = new OleDbCommand _
("UPDATE GROUPDETAILS SET GROUPNAME = ? WHERE GROUPDETAILS.GROUPID = " + this.GroupId.ToString(), dbConnection);

SaveGroupCommand.Parameters.Add("@x",DBType.String).Value="Did it save"
or even:
System.Data.OleDb.OleDbCommand SaveGroupCommand = new OleDbCommand(
				"UPDATE GROUPDETAILS SET GROUPNAME = ? WHERE GROUPDETAILS.GROUPID = ?, dbConnection);

SaveGroupCommand.Parameters.Add("@x",DBType.String).Value="Did it save"
SaveGroupCommand.Parameters.Add("@y,DBType.Int32).Value = this.GroupId '(assuming VFP Int)
Just make sure the order in which the parameter statements are added matches the order of the '?'s in the UPDATE command...
HTH,
Viv
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform