本帖最后由 赵宇 于 2012-9-25 08:36 编辑
- /// <summary>
- /// 执行SQL语句,返回影响的记录数
- /// </summary>
- /// <param name="SQLString">SQL语句</param>
- /// <returns>影响的记录数</returns>
- public static int ExecuteSql(string SQLString,params OracleParameter[] cmdParms)
- {
- using (OracleConnection connection = new OracleConnection(connectionString))
- {
- using (OracleCommand cmd = new OracleCommand())
- {
- try
- {
- PrepareCommand(cmd, connection, null,SQLString, cmdParms);
- int rows=cmd.ExecuteNonQuery();
- cmd.Parameters.Clear();
- return rows;
- }
- catch(System.Data.OracleClient.OracleException E)
- {
- throw new Exception(E.Message);
- }
- }
- }
- }
复制代码
|
|