example below can we get a parameter by name or have to use the indexOf
SqlCommand cmd = new SqlCommand("pro c_ERRORLOG_INSE RT", oConn);
cmd.CommandType = CommandType.Sto redProcedure;
SqlParameter param = new SqlParameter();
cmd.Parameters. Add("@Fileid", SqlDbType.Int). Value=99999;
cmd.Parameters. Add("@ErrorMess age", SqlDbType.VarCh ar).Value="Serv ice Failed
on APP Server1";
cmd.Parameters. Add("@Retvalue" ,
SqlDbType.Int). Direction=Param eterDirection.O utput;
int iret = cmd.ExecuteNonQ uery();
Console.WriteLi ne("return value "+iret.ToString ()); //iRet is Rows
Affected
Console.WriteLi ne(cmd.Paramete rs.IndexOf("@Re tvalue")); // Proc Return
Number (value)
console.Read();
how can i get the @retvalue by name , Not by its index position in the
collection
TIA MJ
SqlCommand cmd = new SqlCommand("pro c_ERRORLOG_INSE RT", oConn);
cmd.CommandType = CommandType.Sto redProcedure;
SqlParameter param = new SqlParameter();
cmd.Parameters. Add("@Fileid", SqlDbType.Int). Value=99999;
cmd.Parameters. Add("@ErrorMess age", SqlDbType.VarCh ar).Value="Serv ice Failed
on APP Server1";
cmd.Parameters. Add("@Retvalue" ,
SqlDbType.Int). Direction=Param eterDirection.O utput;
int iret = cmd.ExecuteNonQ uery();
Console.WriteLi ne("return value "+iret.ToString ()); //iRet is Rows
Affected
Console.WriteLi ne(cmd.Paramete rs.IndexOf("@Re tvalue")); // Proc Return
Number (value)
console.Read();
how can i get the @retvalue by name , Not by its index position in the
collection
TIA MJ
Comment