Can you explain this code?specially this params SqlParameter[] parms ?
public int insUpdata(string procName, params SqlParameter[] parms)
{
//cmd.Connection = conSql;
OpenConnection();
cmd = new SqlCommand(procName, conSql);
if (parms != null)
{
foreach (SqlParameter p in parms)
{
if ((p.Direction == ParameterDirection.InputOutput) && (p.Value == null))
{
p.Value = DBNull.Value;
} cmd.Parameters.Add(p);
}
}
cmd.CommandType = CommandType.StoredProcedure;
int iStatus = cmd.ExecuteNonQuery();
CloseConnection();
return iStatus;
}