Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
From VFP auto incremental key to SQL Server
Message
From
16/10/2006 17:21:49
 
 
To
16/10/2006 17:15:56
General information
Forum:
Microsoft SQL Server
Category:
Import/Export
Miscellaneous
Thread ID:
01162137
Message ID:
01162340
Views:
19
>On second thought, there is something wrong with this code. For each insert, there are now two records being inserted. This is like that since I added the SELECT SCOPE_IDENTITY() in the SQL with the ExecuteScalar().

It seems the ExecuteScalar() with the SQLClient provider does not need any ExecuteNonQuery(). That was causing the command to be executed twice. I had it in there to support for OleDb mode. So, I put a condition to avoid executing that ExecuteNonQuery() line for the SQLClient provider.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform