C# Class EmTrac2SF.DBAccess

Class with static methods to handle all database interaction
Inheritance: IDisposable
Afficher le fichier Open project: fmendes/SalesForceCSharpAPI

Méthodes publiques

Свойство Type Description
Cache System.Web.Caching.Cache
ErrorLabel System.Web.UI.WebControls.Label
ErrorMessage string
MainDB string
iConnectionRetries int
objConn System.Data.SqlClient.SqlConnection
objIsolationLevel IsolationLevel
objLastUpdateRow System.Data.DataRow
objSync object
strLogFlag string
strPath string

Méthodes publiques

Méthode Description
Dispose ( ) : void
GetConnection ( ) : SqlConnection

Creates a SqlConnection using the Default Connection String

GetConnection ( string strName ) : SqlConnection

Creates a SqlConnection using the given Connection String

GetConnectionRef ( string strName ) : SqlConnection
GetConnectionString ( ) : string
GetConnectionString ( string strName ) : string
GetDataSetFromSQL ( string strSQL ) : DataSet
GetDataTableFromSQL ( string strSQL ) : DataTable
GetDataTableFromSQLFile ( string strFileName, string strPrependScript = null, string strCondition = null ) : DataTable
GetIntegerFromSQL ( string strSQL ) : int
GetSQLFromFile ( string strFile ) : string
GetSqlDataReaderFromSQL ( string strSQL ) : System.Data.SqlClient.SqlDataReader
GetStringFromSQL ( string strSQL ) : string
ReplaceApostrophes ( string strValue ) : string
ReportError ( string strErrorMsg ) : void
RunSQL ( string strSQL ) : int
SetConnectionRef ( string strName, SqlConnection sc ) : void
StringFormat ( string strFormat ) : string

Does the same thing as 'string.Format' but duplicating single quotes so it will be accepted in the SQL statement context. Example: O'Hare will become O''Hare

TryConnect ( ) : bool

Opens the connection to the database

TryConnect ( string strName ) : bool

Opens the connection to the database using the given Connection String

UpdateAdapter ( DataSet ds, SqlDataAdapter objSqlAdapter, SqlCommand objComm ) : void
UpdateAdapterRowCheck ( DataSet ds, SqlDataAdapter objSqlAdapter, SqlCommand objComm ) : void
objSqlAdapter_RowUpdated ( object sender, System.Data.SqlClient.SqlRowUpdatedEventArgs e ) : void
objSqlAdapter_RowUpdating ( object sender, System.Data.SqlClient.SqlRowUpdatingEventArgs e ) : void

Méthodes protégées

Méthode Description
Dispose ( bool bNative = true ) : void

Private Methods

Méthode Description
CommitAndDisconnect ( SqlTransaction &objTrans ) : void
RollbackAndReportError ( SqlTransaction &objTrans, Exception excpt ) : void

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool bNative = true ) : void
bNative bool
Résultat void

GetConnection() public méthode

Creates a SqlConnection using the Default Connection String
public GetConnection ( ) : SqlConnection
Résultat System.Data.SqlClient.SqlConnection

GetConnection() public méthode

Creates a SqlConnection using the given Connection String
public GetConnection ( string strName ) : SqlConnection
strName string A connection string
Résultat System.Data.SqlClient.SqlConnection

GetConnectionRef() public méthode

public GetConnectionRef ( string strName ) : SqlConnection
strName string
Résultat System.Data.SqlClient.SqlConnection

GetConnectionString() public méthode

public GetConnectionString ( ) : string
Résultat string

GetConnectionString() public static méthode

public static GetConnectionString ( string strName ) : string
strName string
Résultat string

GetDataSetFromSQL() public méthode

public GetDataSetFromSQL ( string strSQL ) : DataSet
strSQL string
Résultat System.Data.DataSet

GetDataTableFromSQL() public méthode

public GetDataTableFromSQL ( string strSQL ) : DataTable
strSQL string
Résultat System.Data.DataTable

GetDataTableFromSQLFile() public méthode

public GetDataTableFromSQLFile ( string strFileName, string strPrependScript = null, string strCondition = null ) : DataTable
strFileName string
strPrependScript string
strCondition string
Résultat System.Data.DataTable

GetIntegerFromSQL() public méthode

public GetIntegerFromSQL ( string strSQL ) : int
strSQL string
Résultat int

GetSQLFromFile() public méthode

public GetSQLFromFile ( string strFile ) : string
strFile string
Résultat string

GetSqlDataReaderFromSQL() public méthode

public GetSqlDataReaderFromSQL ( string strSQL ) : System.Data.SqlClient.SqlDataReader
strSQL string
Résultat System.Data.SqlClient.SqlDataReader

GetStringFromSQL() public méthode

public GetStringFromSQL ( string strSQL ) : string
strSQL string
Résultat string

ReplaceApostrophes() public static méthode

public static ReplaceApostrophes ( string strValue ) : string
strValue string
Résultat string

ReportError() public méthode

public ReportError ( string strErrorMsg ) : void
strErrorMsg string
Résultat void

RunSQL() public méthode

public RunSQL ( string strSQL ) : int
strSQL string
Résultat int

SetConnectionRef() public méthode

public SetConnectionRef ( string strName, SqlConnection sc ) : void
strName string
sc System.Data.SqlClient.SqlConnection
Résultat void

StringFormat() public static méthode

Does the same thing as 'string.Format' but duplicating single quotes so it will be accepted in the SQL statement context. Example: O'Hare will become O''Hare
public static StringFormat ( string strFormat ) : string
strFormat string String containing zero or more format items.
Résultat string

TryConnect() public méthode

Opens the connection to the database
public TryConnect ( ) : bool
Résultat bool

TryConnect() public méthode

Opens the connection to the database using the given Connection String
public TryConnect ( string strName ) : bool
strName string A Connection String
Résultat bool

UpdateAdapter() public méthode

public UpdateAdapter ( DataSet ds, SqlDataAdapter objSqlAdapter, SqlCommand objComm ) : void
ds System.Data.DataSet
objSqlAdapter System.Data.SqlClient.SqlDataAdapter
objComm System.Data.SqlClient.SqlCommand
Résultat void

UpdateAdapterRowCheck() public méthode

public UpdateAdapterRowCheck ( DataSet ds, SqlDataAdapter objSqlAdapter, SqlCommand objComm ) : void
ds System.Data.DataSet
objSqlAdapter System.Data.SqlClient.SqlDataAdapter
objComm System.Data.SqlClient.SqlCommand
Résultat void

objSqlAdapter_RowUpdated() public méthode

public objSqlAdapter_RowUpdated ( object sender, System.Data.SqlClient.SqlRowUpdatedEventArgs e ) : void
sender object
e System.Data.SqlClient.SqlRowUpdatedEventArgs
Résultat void

objSqlAdapter_RowUpdating() public méthode

public objSqlAdapter_RowUpdating ( object sender, System.Data.SqlClient.SqlRowUpdatingEventArgs e ) : void
sender object
e System.Data.SqlClient.SqlRowUpdatingEventArgs
Résultat void

Property Details

Cache public_oe property

public Cache,System.Web.Caching Cache
Résultat System.Web.Caching.Cache

ErrorLabel public_oe property

public Label,System.Web.UI.WebControls ErrorLabel
Résultat System.Web.UI.WebControls.Label

ErrorMessage public_oe property

public string ErrorMessage
Résultat string

MainDB public_oe property

public string MainDB
Résultat string

iConnectionRetries public_oe static_oe property

public static int iConnectionRetries
Résultat int

objConn public_oe property

public SqlConnection,System.Data.SqlClient objConn
Résultat System.Data.SqlClient.SqlConnection

objIsolationLevel public_oe property

public IsolationLevel objIsolationLevel
Résultat IsolationLevel

objLastUpdateRow public_oe property

public DataRow,System.Data objLastUpdateRow
Résultat System.Data.DataRow

objSync public_oe static_oe property

public static object objSync
Résultat object

strLogFlag public_oe property

public string strLogFlag
Résultat string

strPath public_oe property

public string strPath
Résultat string