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
Quote:
SqlDataSource1.InsertParameters("email").DefaultValue = Emailtextbox.Text
SqlDataSource1.Insert()
thx
Re: sqldatasource, OUTPUT clause