-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCfCommand.ExecuteNonQuery.cs
More file actions
45 lines (40 loc) · 1.38 KB
/
CfCommand.ExecuteNonQuery.cs
File metadata and controls
45 lines (40 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
using System;
using System.Collections.Generic;
using System.Data.Common;
namespace ConnectionFactory
{
public partial class CfCommand
{
#region ExecuteNonQuery
//[System.Diagnostics.DebuggerStepThrough]
public int ExecuteNonQuery(CfCommandType cmdType, string cmdText, IEnumerable<CfParameter> cmdParms = null)
{
Logger.Debug("Begin Method");
try
{
Logger.InfoFormat("ExecuteNonQuery: {0}", cmdText);
Logger.Info(cmdParms);
_conn.EstablishFactoryConnection();
PrepareCommand(cmdType, cmdText, cmdParms);
Logger.Debug("End Method");
return _cmd.ExecuteNonQuery();
}
catch (DbException dbe)
{
Logger.Error(dbe);
throw new CfException("Unknown error in database: " + dbe.Message, dbe);
}
catch (Exception ex)
{
Logger.Error(ex);
throw new CfException("Error on Connection Factory Mechanism: " + ex.Message, ex);
}
}
public int ExecuteNonQuery(CfCommandType cmdType, string cmdText, object cmdParms)
{
var cfParams = ConvertObjectToCfParameters(cmdParms);
return ExecuteNonQuery(cmdType, cmdText, cfParams);
}
#endregion
}
}