StrSql = "Insert into AAA(Name) Values('hello');Select @ID=@@IDENTITY"
m_Command = new SqlCommand( StrSql, m_Connection );
int newid = Convert.ToInt32( m_Command.ExecuteScalar() );
in storeprecedure:
Insert into AAA(Name) Values('hello')
Select @ID=@@IDENTITY
m_Command = new SqlCommand( StrSql, m_Connection );
int newid = Convert.ToInt32( m_Command.ExecuteScalar() );
in storeprecedure:
Insert into AAA(Name) Values('hello')
Select @ID=@@IDENTITY