Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Parameters with the VFPOLEDB provider?
Message
From
01/10/2003 04:23:01
 
 
To
01/10/2003 00:25:25
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00833708
Message ID:
00833731
Views:
29
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
Previous
Reply
Map
View

Click here to load this message in the networking platform