SqlParameter[] parms; SqlConnection conn; using (conn = new SqlConnection(connString)) {
SqlCommand cmd = new SqlCommand(sProcedureName, conn); cmd.CommandType = CommandType.StoredProcedure; conn.Open(); SqlCommandBuilder.DeriveParameters(cmd); parms = new SqlParameter[cmd.Parameters.Count];
SqlCommand cmd = new SqlCommand(sProcedureName, conn);
cmd.CommandType = CommandType.StoredProcedure;
conn.Open();
SqlCommandBuilder.DeriveParameters(cmd);
parms = new SqlParameter[cmd.Parameters.Count];
for (int i = 0; i < cmd.Parameters.Count; i++) {
for (int i = 0; i < cmd.Parameters.Count; i++)
{
parms[i]=new SqlParameter(); parms[i].ParameterName=cmd.Parameters[i].ParameterName; parms[i].SqlDbType=cmd.Parameters[i].SqlDbType; parms[i].Size=cmd.Parameters[i].Size;
parms[i]=new SqlParameter();
parms[i].ParameterName=cmd.Parameters[i].ParameterName;
parms[i].SqlDbType=cmd.Parameters[i].SqlDbType;
parms[i].Size=cmd.Parameters[i].Size;
}
} conn.Close(); conn.Dispose(); /* Remove parms[0] ? */ return parms;