TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rania Magdy
NA
9
0
Get the Identity by ExecuteScalar
Aug 27 2009 3:48 AM
Dears,
I want to Insert row and retrieve the Identity : SqlCommand cmd1 = new SqlCommand( "INSERT INTO SalesTable (ProductId, CustomerId, Qty, SaleDate, SalePrice, SalePolicy, Notes) " + " VALUES (@ProductId, @CustomerId, @Qty, @SaleDate, @SalePrice, @SalePolicy, @Notes)" + " SELECT SCOPE_IDENTITY() ", dbModule.con); each time the execute scaller return Empty (Guid should contain 32 digits .....) I tried many ways with both Scallar and Reader would u plz tell me the write way to code this
Thanks
Reply
Answers (
3
)
Implementation of DailyRecurrence in vb.net
Converting SID from binary to decimal