Returnig parametrs from sql statment
-
hellow to all .. i am trying to return a parameter from sql statment that i insert , how can i do it ? for example i have a sql statment that inset into a table i wanna when i insert a value to Return the indx that i just inset or created ... if anyone can please direct me or help me i will be thankfull ....
-
hellow to all .. i am trying to return a parameter from sql statment that i insert , how can i do it ? for example i have a sql statment that inset into a table i wanna when i insert a value to Return the indx that i just inset or created ... if anyone can please direct me or help me i will be thankfull ....
http://www.developerfusion.co.uk/show/4278/3/[^] In a nutshell: // add a new parameter, with any name we want - its for our own use only SqlParameter sqlParam = com.Parameters.Add("@ReturnValue", SqlDbType.Int); // set the direction flag so that it will be filled with the return value myParm.Direction = ParameterDirection.ReturnValue; Then, after the stored procedure has been executed, int returnValue = (int)com.Parameters["@ReturnValue"].Value
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog