Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLEDB Command completion
Message
De
07/03/2011 11:25:30
 
 
À
07/03/2011 08:57:25
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01502804
Message ID:
01502846
Vues:
45
>This is a free VFP table with no primary key or autoinc column
>I just want to know that the insertion has been completed before moving on to the next instruction


ExecuteNonQuery() should complete the operation and the row should be inserted. However, if you have some other activity being dependent on rows saved to the VFP table, you might also want to look at using transactions. It's been a long time since I worked with VFP tables (and never from .NET), so I don't know if transactions are supported with VFP free tables or not.

But, in any case, the answer to your original question is yes.

~~Bonnie









>Michel
>
>Thank you for your reply.
>
>This is a free VFP table with no primary key or autoinc column
>I just want to know that the insertion has been completed before moving on to the next instruction
>
>
>
>
>>I want to be sure that a row has been inserted in an OLEDB VFP table before proceeding to the next instruction.
>>Does ExecuteNonQuery complete the OLEDB command before continuing to the next instruction?
>>If not, what's the best way to be sure that the row has been inserted before proceeding?
>
>Once you have done this:
>
>oDataAdapter.SelectCommand.ExecuteNonQuery()
>
>You can do this to get the primary key:
>
>oCommand.CommandText = "GETAUTOINCVALUE(0)"
>oCommand.CommandType = CommandType.StoredProcedure
>nPrimaryKey = CInt(oCommand.ExecuteScalar())
>
>Where oDataAdapter and oCommand represent your object to their respective classes.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform