public static int update(string sql, SqlParameter[] parameter) { SqlConnection conn = new SqlConnection(connString); SqlCommand cmd = new SqlCommand(sql, conn); try { conn.Open(); cmd.Parameters.Add(parameter); int result = cmd.ExecuteNonQuery(); return result; } catch (Exception ex) { throw ex; } finally { conn.Close(); } }