SqlCommand cmd2 = new SqlCommand("SELECT max(id) from orders) ", con); int id=cmd2.ExecuteScalar();
Mark This Response as Answer -- Chandu http://www.dotnetfunda.com/images/dnfmvp.gif
create procedure usp_insertOrders( @col1 int, @col2 varchar) as begin insert into orders(col1, col2) values(@col1, @col2); select scope_identity() as identityValue end
Login to post response