Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP table and generating PK
Message
De
09/04/2002 16:08:39
 
 
À
09/04/2002 10:18:56
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00642479
Message ID:
00642878
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform