Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Using Parameters with the VFPOLEDB provider?
Message
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00833708
Message ID:
00833711
Views:
23
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform