ado执行upadte

        /// <summary>
        /// 目标数据库执行ExecuteNonQuery操作
        /// </summary>
        /// <param name="sql"></param>
        /// <returns></returns>
        private bool TragetDataBaseExecuteSql(string sql)
        {
            using (SqlConnection conn = new SqlConnection(m_TargetDbConnectionInfo.ConnectionString))
            {
                conn.Open();
                SqlCommand cmd = new SqlCommand(sql, conn);
                return cmd.ExecuteNonQuery() > 0;
            }
        }

 

posted @ 2017-04-10 13:53  麦田HH  阅读(137)  评论(0编辑  收藏  举报