Suppose in stored procedure we have like this
set @lastinserted=(select ident_current('user_referencerecord'))
set @exist=0
Now to return two variables
select @exist as exist,@lastinserted as lastinserted
To recieve at .cs page
using (SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while (rdr.Read())
{
returnval1=rdr.GetInt32(rdr.GetOrdinal("exist"));
int returnval2 = rdr.GetInt32(rdr.GetOrdinal("lastinserted"));
}
}
set @lastinserted=(select ident_current('user_referencerecord'))
set @exist=0
Now to return two variables
select @exist as exist,@lastinserted as lastinserted
To recieve at .cs page
using (SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection))
{
while (rdr.Read())
{
returnval1=rdr.GetInt32(rdr.GetOrdinal("exist"));
int returnval2 = rdr.GetInt32(rdr.GetOrdinal("lastinserted"));
}
}
No comments:
Post a Comment