C# Класс CinderellaMGS.DatabaseIO

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
globConnectionString string

Открытые методы

Метод Описание
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.

RetrieveConnectionString ( ) : string

Attempts to read the connection string from the computers registry. If it doesn't exist a new key is created.

checkConnection ( ) : bool

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

createNewConnection ( ) : string

Creates and returns a connection string key in the computers registry.

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.

setupConnection ( ) : void

Checks for a valid connection string and tries to establish a connection to the database. If the connection fails the user is given an opportunity to enter a new connection string.

Приватные методы

Метод Описание
errorCheck ( Exception errorMessage ) : void

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

Описание методов

CheckForRows() публичный Метод

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
Результат bool

CloseConnection() публичный Метод

Closes the connection if it is open.
public CloseConnection ( ) : void
Результат void

DatabaseIO() публичный Метод

public DatabaseIO ( ) : System
Результат System

ExecuteQuery() публичный Метод

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.
Результат int

GetConnection() публичный Метод

Creates the SQLConnection object "conn" which is used throughout the rest of the databaseIO methods.
public GetConnection ( ) : SqlConnection
Результат System.Data.SqlClient.SqlConnection

GetRows() публичный Метод

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
Результат int

RetrieveConnectionString() публичный Метод

Attempts to read the connection string from the computers registry. If it doesn't exist a new key is created.
public RetrieveConnectionString ( ) : string
Результат string

checkConnection() публичный Метод

This method will check for a valid connection string and try opening a new connection.
public checkConnection ( ) : bool
Результат bool

createNewConnection() публичный Метод

Creates and returns a connection string key in the computers registry.
public createNewConnection ( ) : string
Результат string

getAggDataString() публичный Метод

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.
Результат string

getDataSet() публичный Метод

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.
Результат System.Data.DataSet

setupConnection() публичный Метод

Checks for a valid connection string and tries to establish a connection to the database. If the connection fails the user is given an opportunity to enter a new connection string.
public setupConnection ( ) : void
Результат void

Описание свойств

globConnectionString публичное свойство

public string globConnectionString
Результат string