|
-
Jun 30th, 2012, 10:38 PM
#1
Thread Starter
Frenzied Member
sqldatasource, OUTPUT clause
Hi,
On my page i have a sqldatasource object, I already filled the select, update... queries and currently it works fine. But i recently learned about the OUTPUT SQL clause, which is able to return the last inserted data ID .
Code:
INSERT INTO aa
)
OUTPUT INSERTED.ID AS 'New User ID'
values
('haha')
GO
this code works fine when i run it on SQL direct, but on my sqldatasource object, i'm not sure how to retrieve the return value? But i'm not sure how to get the return value just after doing the insert command.
currently to insert data with mysqldatasource i use
SqlDataSource1.InsertParameters("email").DefaultValue = Emailtextbox.Text
SqlDataSource1.Insert()
thx
Last edited by met0555; Jul 2nd, 2012 at 09:55 AM.
-
Jul 2nd, 2012, 09:55 AM
#2
Thread Starter
Frenzied Member
Re: sqldatasource, OUTPUT clause
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|