Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TableAdapter - how to get two keys after insert?
Message
From
07/05/2009 11:37:18
John Baird
Coatesville, Pennsylvania, United States
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Environment versions
Environment:
C# 3.0
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01398218
Message ID:
01398384
Views:
63
This message has been marked as a message which has helped to the initial question of the thread.
>Hi everybody,
>
>I have Orders Table (PK Guid, OrderDate) I also added identity column to this table (though this change was not yet reflected in my DS).
>
>Now, how can I add a new method to my TableAdapter to return both GUID and ID for my insert
>
>(which I suppose should be insert into Orders (OrderDate) values (Getdate())
>
>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..
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform