Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update VFP data from C#
Message
From
03/05/2004 12:37:04
 
 
To
03/05/2004 08:38:41
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00900338
Message ID:
00900433
Views:
27
Mark,

Sorry, I read the wrong post and didn't realize you were the original poster. I sent it to Dmitry by mistake...sorry, guess I need more coffee today.
********************

I had to update VFP data from C# a little while ago. Here's something that might help...(you'll need the latest OLE DB Provider for VFP)

Here's a really simple example of updating an invoice amount based on a key


using System.Data.OleDb;

string cUpdateCmd;
cUpdateCmd = " UPDATE Invoices SET INVAMT = 1000 WHERE INVOICEID = 2";
OleDbConnection oConn;
oConn = new OleDbConnection("Provider=VFPOLEDB.1;" +
"Data Source=c:\\masonry\\data\\mydbc.dbc");
oConn.Open();
OleDbCommand MyCommand = new OleDbCommand();
MyCommand.Connection = oConn;
MyCommand.CommandText = cUpdateCmd;
MyCommand.ExecuteNonQuery();

Again, very basic, and there may be other ways to code it, but hopefully that will get you started. The VFP Ole DB Provider has one or two code samples in the help file, I believe.

Kevin
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform