Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Inserting a new record via OleDbCommand
Message
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00693070
Message ID:
00694020
Vues:
27
>Oh, I see. I forgot to change SQL ref in all statements. Did you try
>
>
>
>OleParameter myParm = OleCMD.Parameters.Add("@TableId", OleDbType.VarChar, 15);
>
I just got it to work using the following:
System.Data.OleDb.OleDbCommand oleCmd = new System.Data.OleDb.OleDbCommand();
oleCmd.Connection = "(my long connection string removed";

oleCmd.CommandText = "NewID('user')";
string strRes = oleCmd.ExecuteScalar().ToString();
This assumes that the first column is the ID field. I'll have to play with getting return values from a VFP store procedure, but for now this will work. And, for some reason, it doesn't want to cast to an integer: int iRet = oleCmd.ExecuteScalar(); I'll have to play around with the syntax some more (even though it is shown this way in the docs).
-Paul

RCS Solutions, Inc.
Blog
Twitter
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform