C# Класс greenapple.Connectoperations

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

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

Метод Описание
delete ( string table, string where ) : int

deletes records from the database

describeTable ( string table ) : DataTable

gets the attributes of a table

insert ( string table, string attributes, string values ) : int

inserts a record into the database

mysqldate ( System.DateTime dat ) : string

this function converts .NET datetime to mysql date format

selectdatable ( string table, string attributes, string where ) : DataTable

retrives data from the database and puts it to a table

showDatabaseTables ( ) : DataTable

retrieves all the database tables for a given database

singleval ( string table, string attribute, string where ) : string

Retrieves only a cell from the database table

update ( string table, string attributes, string values, string where ) : int

updates the database

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

delete() публичный метод

deletes records from the database
public delete ( string table, string where ) : int
table string table from whic data is to be deleted
where string the where clause used eg 'where id=1'
Результат int

describeTable() публичный метод

gets the attributes of a table
public describeTable ( string table ) : DataTable
table string the table whose attribute is being got
Результат System.Data.DataTable

insert() публичный метод

inserts a record into the database
public insert ( string table, string attributes, string values ) : int
table string table into which a record is to be inserted
attributes string attributes in the table that whose data is being inserted
values string values to the attributes of the table whose data is being inserted
Результат int

mysqldate() публичный метод

this function converts .NET datetime to mysql date format
public mysqldate ( System.DateTime dat ) : string
dat System.DateTime the datetime object being converted to mysql date format
Результат string

selectdatable() публичный метод

retrives data from the database and puts it to a table
public selectdatable ( string table, string attributes, string where ) : DataTable
table string table whose data is being retrieved
attributes string attributes of the table which is being retived
where string the where clause eg "where id>1 and name='guy'"
Результат System.Data.DataTable

showDatabaseTables() публичный метод

retrieves all the database tables for a given database
public showDatabaseTables ( ) : DataTable
Результат System.Data.DataTable

singleval() публичный метод

Retrieves only a cell from the database table
public singleval ( string table, string attribute, string where ) : string
table string table whose cell is being retrieved
attribute string attribute being retrieved
where string the where clause and this is mandatory
Результат string

update() публичный метод

updates the database
public update ( string table, string attributes, string values, string where ) : int
table string the table being updated
attributes string the attributes to update
values string the values that correspond to the attributes
where string the clause to be used eg' where id=1'
Результат int