Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Update VFP data from C#
Message
 
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
00900338
Message ID:
00900460
Views:
33
I can always learn something. Thank you.

>Dmitry,
>
>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
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform