Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP table and generating PK
Message
From
09/04/2002 16:08:39
 
 
To
09/04/2002 10:18:56
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00642479
Message ID:
00642878
Views:
15
It took a while to find information but I re-read chapter 5 of "What's New in VFP 7" which discussed the new OLE DB provider than I'm using to connect. It supports many of the VFP functions. So the code below works. However, I am attempting to figure out is it better to use a return value (the PK) from a procedure then passing the value to the standard Ado.net update and add routines. Or is attempting to use the stored procedure from the insert (by inserting it into the call into the command text better?


private void insertbutton_Click(object sender, System.EventArgs e)
{
oleDbConnection1.Open();
//serialnumber() is a stored procedure written by a member of the UT
//serialnumber('esagency')
string sqlSelect = "INSERT INTO mytest (agencyid,name)VALUES (serialnumber('esagency'),'test')";

System.Data.OleDb.OleDbCommand mysqlcmd = new System.Data.OleDb.OleDbCommand(sqlSelect,oleDbConnection1);

mysqlcmd.ExecuteNonQuery();
oleDbConnection1.Close();
}
John Fabiani
Woodland, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform