Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TableAdapter - how to get two keys after insert?
Message
De
07/05/2009 23:03:16
John Baird
Coatesville, Pennsylvanie, États-Unis
 
 
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01398218
Message ID:
01398510
Vues:
83
This message has been marked as the solution to the initial question of the thread.
>>>I need to return back SCOPE_IDENTITY() as well as NewID(). Or at least NewID() that I'm putting there as ID of the order may not be that important, though I may want to display it.
>>>
>>>I can not use SP as it's SQL Server CE.
>>>
>>>Appreciate your ideas.
>>
>>
>>You cannot batch calls to sqlce. the sample code shows how to do this..
>
>John,
>
>Are you sure this would not work
>INSERT INTO [Orders] ([OrderPk], [OrderDate]) VALUES (@NewOrder, GetDate()); return Scope_Identity()
>
>and I need to use the exact idea from your article?
>
>Thanks again.

SQLCe does not support batch queries. You cannot chain commands with ';' and get them to work. Follow the method from my article, AFAIK, its the only way to get the identity.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform