public static int ExecuteCommand(string sql, SqlConnection conn) { int nRet = 1; if (Program.EnableRemoting && false) { nRet = mDataTableProxy.ExecuteCommand(string.Empty, sql); } else { if (conn.State == ConnectionState.Closed) { conn.Open(); } try { SqlCommand cmd = conn.CreateCommand(); cmd.CommandText = sql; nRet = cmd.ExecuteNonQuery(); } catch { throw; } finally { conn.Close(); } } return(nRet); }