C# Class greenapple.Connectoperations

Afficher le fichier Open project: mistaguy/greenapple Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

delete() public méthode

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'
Résultat int

describeTable() public méthode

gets the attributes of a table
public describeTable ( string table ) : DataTable
table string the table whose attribute is being got
Résultat System.Data.DataTable

insert() public méthode

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
Résultat int

mysqldate() public méthode

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
Résultat string

selectdatable() public méthode

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'"
Résultat System.Data.DataTable

showDatabaseTables() public méthode

retrieves all the database tables for a given database
public showDatabaseTables ( ) : DataTable
Résultat System.Data.DataTable

singleval() public méthode

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
Résultat string

update() public méthode

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'
Résultat int