C Sharp语言执行SQL语句的方法

 时间:2024-10-30 21:04:59

1、 public static bool sqlExecuteNonQuery(string strSql) //执行SQL语句方法,并且无返回值 { if (m_dbTransaction == null) { connectionOpen(); //如果没有事务,则首先打开数据库连接 } try { m_dbCommand.CommandText = strSql; m_dbCommand.CommandType = CommandType.Text; m_dbCommand.ExecuteNonQuery(); //执行SQL语句 return true; } catch (Exception ex) { WriteLog.WriteSQLErrorLog("OracleDBAccess", "sqlExecuteNonQuery", strSql, ex.Message); throw ex;//抛出异常 } finally { if (m_dbTransaction == null) { connectionClose();//关闭数据库连接 } } }

C Sharp语言执行SQL语句的方法
  • 怎样安装使用Ad Muncher过滤浏览器、视频前广告
  • IntelliJ IDEA如何设置JDK的下载路径#校园分享#
  • 网站流量监控功能教程
  • trycatch与finally语句哪个可以不要?
  • 网狐棋牌框架数据库相关说明
  • 热门搜索
    双是什么意思 origin是什么意思 派遣证有什么用 年迈的意思 利培酮片治什么病 season是什么意思 什么是酒精过敏 检阅的意思 内敛的意思 瞬间的意思