C# Class greenapple.Connectoperations

Datei anzeigen Open project: mistaguy/greenapple Class Usage Examples

Public Methods

Method 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 method

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'
return int

describeTable() public method

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

insert() public method

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
return int

mysqldate() public method

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
return string

selectdatable() public method

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'"
return System.Data.DataTable

showDatabaseTables() public method

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

singleval() public method

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
return string

update() public method

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'
return int