Class SqlHelper
Inheritance
System.Object
SqlHelper
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: FChoice.Common.dll
Syntax
Constructors
SqlHelper()
Declaration
SqlHelper(DbProvider)
Declaration
public SqlHelper(DbProvider dataProvider)
Parameters
SqlHelper(DbProvider, CommandType, String)
Declaration
public SqlHelper(DbProvider dataProvider, CommandType inCmdType, string cmdTxt)
Parameters
Type |
Name |
Description |
DbProvider |
dataProvider |
|
System.Data.CommandType |
inCmdType |
|
System.String |
cmdTxt |
|
SqlHelper(DbProvider, String)
Declaration
public SqlHelper(DbProvider dataProvider, string cmdTxt)
Parameters
Type |
Name |
Description |
DbProvider |
dataProvider |
|
System.String |
cmdTxt |
|
SqlHelper(CommandType, String)
Declaration
public SqlHelper(CommandType inCmdType, string cmdTxt)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
inCmdType |
|
System.String |
cmdTxt |
|
SqlHelper(String)
Declaration
public SqlHelper(string cmdTxt)
Parameters
Type |
Name |
Description |
System.String |
cmdTxt |
|
Fields
IN_LIST_TOKEN
Declaration
public const string IN_LIST_TOKEN = "{INLIST}"
Field Value
Type |
Description |
System.String |
|
Properties
CommandText
Declaration
public string CommandText { get; set; }
Property Value
Type |
Description |
System.String |
|
CommandType
Declaration
public CommandType CommandType { get; set; }
Property Value
Type |
Description |
System.Data.CommandType |
|
Connection
Declaration
public IDbConnection Connection { get; set; }
Property Value
Type |
Description |
System.Data.IDbConnection |
|
DataProvider
Declaration
public DbProvider DataProvider { get; set; }
Property Value
Log
Declaration
public static Logger Log { get; }
Property Value
Parameters
Declaration
public DataParameterCollection Parameters { get; }
Property Value
Transaction
Declaration
public IDbTransaction Transaction { get; set; }
Property Value
Type |
Description |
System.Data.IDbTransaction |
|
Methods
ExecuteDataSet()
Declaration
public DataSet ExecuteDataSet()
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(CommandType, String)
Declaration
public static DataSet ExecuteDataSet(CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(CommandType, String, DataParameterCollection)
Declaration
public static DataSet ExecuteDataSet(CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(IDbConnection, CommandType, String)
Declaration
public static DataSet ExecuteDataSet(IDbConnection connection, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(IDbConnection, CommandType, String, DataParameterCollection)
Declaration
public static DataSet ExecuteDataSet(IDbConnection connection, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(IDbTransaction, CommandType, String)
Declaration
public static DataSet ExecuteDataSet(IDbTransaction transaction, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(IDbTransaction, CommandType, String, DataParameterCollection)
Declaration
public static DataSet ExecuteDataSet(IDbTransaction transaction, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSet(String)
Declaration
public static DataSet ExecuteDataSet(string commandText)
Parameters
Type |
Name |
Description |
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteDataSetInList(Object[], String)
Declaration
public DataSet ExecuteDataSetInList(object[] inList, string columnName)
Parameters
Type |
Name |
Description |
System.Object[] |
inList |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.Data.DataSet |
|
ExecuteNonQuery()
Declaration
public int ExecuteNonQuery()
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(CommandType, String)
Declaration
public static int ExecuteNonQuery(CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(CommandType, String, DataParameterCollection)
Declaration
public static int ExecuteNonQuery(CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(IDbConnection, CommandType, String)
Declaration
public static int ExecuteNonQuery(IDbConnection connection, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(IDbConnection, CommandType, String, DataParameterCollection)
Declaration
public static int ExecuteNonQuery(IDbConnection connection, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(IDbTransaction, CommandType, String)
Declaration
public static int ExecuteNonQuery(IDbTransaction transaction, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(IDbTransaction, CommandType, String, DataParameterCollection)
Declaration
public static int ExecuteNonQuery(IDbTransaction transaction, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQuery(String)
Declaration
public static int ExecuteNonQuery(string commandText)
Parameters
Type |
Name |
Description |
System.String |
commandText |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteNonQueryInList(Object[], String)
Declaration
public int ExecuteNonQueryInList(object[] inList, string columnName)
Parameters
Type |
Name |
Description |
System.Object[] |
inList |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.Int32 |
|
ExecuteReader()
Declaration
public IDataReader ExecuteReader()
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(CommandType, String)
Declaration
public static IDataReader ExecuteReader(CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(CommandType, String, DataParameterCollection)
Declaration
public static IDataReader ExecuteReader(CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(IDbConnection, CommandType, String)
Declaration
public static IDataReader ExecuteReader(IDbConnection connection, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(IDbConnection, CommandType, String, DataParameterCollection)
Declaration
public static IDataReader ExecuteReader(IDbConnection connection, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(IDbTransaction, CommandType, String)
Declaration
public static IDataReader ExecuteReader(IDbTransaction transaction, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(IDbTransaction, CommandType, String, DataParameterCollection)
Declaration
public static IDataReader ExecuteReader(IDbTransaction transaction, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReader(String)
Declaration
public static IDataReader ExecuteReader(string commandText)
Parameters
Type |
Name |
Description |
System.String |
commandText |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteReaderInList(Object[], String)
Declaration
public IDataReader ExecuteReaderInList(object[] inList, string columnName)
Parameters
Type |
Name |
Description |
System.Object[] |
inList |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.Data.IDataReader |
|
ExecuteScalar()
Declaration
public object ExecuteScalar()
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(CommandType, String)
Declaration
public static object ExecuteScalar(CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(CommandType, String, DataParameterCollection)
Declaration
public static object ExecuteScalar(CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(IDbConnection, CommandType, String)
Declaration
public static object ExecuteScalar(IDbConnection connection, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(IDbConnection, CommandType, String, DataParameterCollection)
Declaration
public static object ExecuteScalar(IDbConnection connection, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbConnection |
connection |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(IDbTransaction, CommandType, String)
Declaration
public static object ExecuteScalar(IDbTransaction transaction, CommandType commandType, string commandText)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(IDbTransaction, CommandType, String, DataParameterCollection)
Declaration
public static object ExecuteScalar(IDbTransaction transaction, CommandType commandType, string commandText, DataParameterCollection commandParams)
Parameters
Type |
Name |
Description |
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
commandType |
|
System.String |
commandText |
|
DataParameterCollection |
commandParams |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalar(String)
Declaration
public static object ExecuteScalar(string commandText)
Parameters
Type |
Name |
Description |
System.String |
commandText |
|
Returns
Type |
Description |
System.Object |
|
ExecuteScalarInList(Object[], String)
Declaration
public object ExecuteScalarInList(object[] inList, string columnName)
Parameters
Type |
Name |
Description |
System.Object[] |
inList |
|
System.String |
columnName |
|
Returns
Type |
Description |
System.Object |
|
FillDataSet(DbDataAdapter, DataSet, String[], IDbTransaction, CommandType, String, DataParameterCollection, Boolean)
Declaration
public static void FillDataSet(DbDataAdapter adapter, DataSet ds, string[] tableNames, IDbTransaction transaction, CommandType cmdType, string cmdText, DataParameterCollection dataParams, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.Common.DbDataAdapter |
adapter |
|
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
DataParameterCollection |
dataParams |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, Boolean, String[])
Declaration
public void FillDataSet(DataSet ds, bool fillSchema, params string[] tableNames)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.Boolean |
fillSchema |
|
System.String[] |
tableNames |
|
FillDataSet(DataSet, String, String[])
Declaration
public static void FillDataSet(DataSet ds, string sqlStmt, string[] tableNames)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String |
sqlStmt |
|
System.String[] |
tableNames |
|
FillDataSet(DataSet, String, String[], Boolean)
Declaration
public static void FillDataSet(DataSet ds, string sqlStmt, string[] tableNames, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String |
sqlStmt |
|
System.String[] |
tableNames |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[])
Declaration
public void FillDataSet(DataSet ds, params string[] tableNames)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
FillDataSet(DataSet, String[], CommandType, String, DataParameterCollection, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, CommandType cmdType, string cmdText, DataParameterCollection dataParams, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
DataParameterCollection |
dataParams |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[], CommandType, String, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, CommandType cmdType, string cmdText, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[], IDbConnection, CommandType, String, DataParameterCollection, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, IDbConnection conn, CommandType cmdType, string cmdText, DataParameterCollection dataParams, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.IDbConnection |
conn |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
DataParameterCollection |
dataParams |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[], IDbConnection, CommandType, String, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, IDbConnection conn, CommandType cmdType, string cmdText, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.IDbConnection |
conn |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[], IDbTransaction, CommandType, String, DataParameterCollection, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, IDbTransaction transaction, CommandType cmdType, string cmdText, DataParameterCollection dataParams, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.IDbTransaction |
transaction |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
DataParameterCollection |
dataParams |
|
System.Boolean |
fillSchema |
|
FillDataSet(DataSet, String[], IDbTransaction, CommandType, String, Boolean)
Declaration
public static void FillDataSet(DataSet ds, string[] tableNames, IDbTransaction trans, CommandType cmdType, string cmdText, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
System.Data.IDbTransaction |
trans |
|
System.Data.CommandType |
cmdType |
|
System.String |
cmdText |
|
System.Boolean |
fillSchema |
|
FillDataSetInList(DataSet, Object[], String)
Declaration
public void FillDataSetInList(DataSet ds, object[] inList, string columnName)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.Object[] |
inList |
|
System.String |
columnName |
|
FillDataSetInList(DataSet, Object[], String, String, Boolean)
Declaration
public void FillDataSetInList(DataSet ds, object[] inList, string columnName, string tableName, bool fillSchema)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.Object[] |
inList |
|
System.String |
columnName |
|
System.String |
tableName |
|
System.Boolean |
fillSchema |
|
FillDataSetRaw(DataSet, Boolean, String[])
Declaration
public static void FillDataSetRaw(DataSet ds, bool fillSchema, params string[] tableNames)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.Boolean |
fillSchema |
|
System.String[] |
tableNames |
|
FillDataSetRaw(DataSet, String[])
Declaration
public static void FillDataSetRaw(DataSet ds, params string[] tableNames)
Parameters
Type |
Name |
Description |
System.Data.DataSet |
ds |
|
System.String[] |
tableNames |
|
GetTableAsDataSet(String)
Declaration
public static DataSet GetTableAsDataSet(string tableName)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
Returns
Type |
Description |
System.Data.DataSet |
|
GetTableAsDataSet(String, String)
Declaration
public static DataSet GetTableAsDataSet(string tableName, string orderBy)
Parameters
Type |
Name |
Description |
System.String |
tableName |
|
System.String |
orderBy |
|
Returns
Type |
Description |
System.Data.DataSet |
|
PrepareInListStatement(Int32, DataParameterCollection, Object[], String, String)
Declaration
public string PrepareInListStatement(int paramBaseNum, DataParameterCollection dataParams, object[] inList, string columnName, string text)
Parameters
Type |
Name |
Description |
System.Int32 |
paramBaseNum |
|
DataParameterCollection |
dataParams |
|
System.Object[] |
inList |
|
System.String |
columnName |
|
System.String |
text |
|
Returns
Type |
Description |
System.String |
|
PrepareInListStatement(Int32, DataParameterCollection, Object[], String, String, IDbDataParameter)
Declaration
public string PrepareInListStatement(int paramBaseNum, DataParameterCollection dataParams, object[] inList, string columnName, string text, IDbDataParameter parameterTemplate)
Parameters
Type |
Name |
Description |
System.Int32 |
paramBaseNum |
|
DataParameterCollection |
dataParams |
|
System.Object[] |
inList |
|
System.String |
columnName |
|
System.String |
text |
|
System.Data.IDbDataParameter |
parameterTemplate |
|
Returns
Type |
Description |
System.String |
|
PrepareInListStatement(Int32[], String, String)
Declaration
public string PrepareInListStatement(int[] inList, string columnName, string text)
Parameters
Type |
Name |
Description |
System.Int32[] |
inList |
|
System.String |
columnName |
|
System.String |
text |
|
Returns
Type |
Description |
System.String |
|
PrepareInListStatement(Object[], String, String)
Declaration
public string PrepareInListStatement(object[] inList, string columnName, string text)
Parameters
Type |
Name |
Description |
System.Object[] |
inList |
|
System.String |
columnName |
|
System.String |
text |
|
Returns
Type |
Description |
System.String |
|
PrepareIntegerListStatement(Int32[], String, String)
Declaration
public string PrepareIntegerListStatement(int[] intList, string columnName, string text)
Parameters
Type |
Name |
Description |
System.Int32[] |
intList |
|
System.String |
columnName |
|
System.String |
text |
|
Returns
Type |
Description |
System.String |
|