C# Class CinderellaLauncher.DatabaseIO

Afficher le fichier Open project: ThomasMoreCollege/CinderellaMGS Class Usage Examples

Méthodes publiques

Méthode Description
CheckForRows ( string sqlStatement ) : bool

This method allowed you to determine if an sql statement will return any rows.

CloseConnection ( ) : void

Closes the connection if it is open.

DatabaseIO ( ) : System
ExecuteQuery ( string sqlStatement ) : int

Method will execute a non query SQL statement and return the number of rows affected.

GetConnection ( ) : SqlConnection

Creates the SQLConnection object "conn" which is used throughout the rest of the databaseIO methods.

GetRows ( string sqlStatement ) : int

This method will allow you to determine how many rows will be returned from an sql query.

ReturnFirstCellInt ( string sqlStatement ) : int
ReturnFirstCellString ( string sqlStatement ) : string
checkConnection ( ) : bool

This method will check for a valid connection string and try opening a new connection.

getAggDataString ( string sqlComm, string tableName ) : string

Method used when executing an sql query that is retrieving aggregate data.

getDataSet ( string sqlComm, string tableName ) : DataSet

This method will allow you to retrieve a dataset containing the data from the executed query.

Private Methods

Méthode Description
errorCheck ( Exception errorMessage ) : void

Method is used to help centralize and customize database error messages.

Method Details

CheckForRows() public méthode

This method allowed you to determine if an sql statement will return any rows.
public CheckForRows ( string sqlStatement ) : bool
sqlStatement string SQL Query to use
Résultat bool

CloseConnection() public méthode

Closes the connection if it is open.
public CloseConnection ( ) : void
Résultat void

DatabaseIO() public méthode

public DatabaseIO ( ) : System
Résultat System

ExecuteQuery() public méthode

Method will execute a non query SQL statement and return the number of rows affected.
public ExecuteQuery ( string sqlStatement ) : int
sqlStatement string SQL Query to be executed.
Résultat int

GetConnection() public méthode

Creates the SQLConnection object "conn" which is used throughout the rest of the databaseIO methods.
public GetConnection ( ) : SqlConnection
Résultat System.Data.SqlClient.SqlConnection

GetRows() public méthode

This method will allow you to determine how many rows will be returned from an sql query.
public GetRows ( string sqlStatement ) : int
sqlStatement string SQL Query to use
Résultat int

ReturnFirstCellInt() public méthode

public ReturnFirstCellInt ( string sqlStatement ) : int
sqlStatement string
Résultat int

ReturnFirstCellString() public méthode

public ReturnFirstCellString ( string sqlStatement ) : string
sqlStatement string
Résultat string

checkConnection() public méthode

This method will check for a valid connection string and try opening a new connection.
public checkConnection ( ) : bool
Résultat bool

getAggDataString() public méthode

Method used when executing an sql query that is retrieving aggregate data.
public getAggDataString ( string sqlComm, string tableName ) : string
sqlComm string SQL Aggregate Query
tableName string The specific table within the dataset.
Résultat string

getDataSet() public méthode

This method will allow you to retrieve a dataset containing the data from the executed query.
public getDataSet ( string sqlComm, string tableName ) : DataSet
sqlComm string The SQL query you are using to retrieve the dataset
tableName string The specific table within the dataset.
Résultat System.Data.DataSet