create library in c sharp

Dec 14 2005 8:45 AM
Hi Guys

my object is ....

i have one data base.
i m using some screen(forms) to fetching thes data in text file, there is some tables in data base n hav to fetch data from these tables through forms.

for that i hav to create library n hav to put my coding in that.
so help me out for it.i m putting my problem here, so plz give me coding for that.

i m very new in that n if i will do that then i will get job. so help me out.

Thanx.

Vega . Solution.DatabaseUtility:

 

Class: DBUtility

  {      

     Public StrtingCollection.GetAllDatabases();

 

      Protected ArrayList GetAllTables();

Public  StringColl GetAllNonSystemTable()

Public ArrayList GetAllColumnsForTable(String TableName);

Public ArrayList GetAllRowsForTable(String TableName);

 

Public String DBConnectionString;

}

 

 


through SQLData Adapter and SQL DataReader()

use System .Collection.Spciality;

 

 

StringColl GetAllDatabases( )

{

try{

sqlconnection oConn=new SqlConnection(this.DBConnectionString);

SqlReader oReader;

è    Sqlcommand oCommand= new Sqlcommand(“SP_databases0”,oConn);

è    OCommand.CommandType=CommandType.StoredProcedure;

Oreader=oCommand.Executereader();

While(oReader.Movenext()){

DatabasesNames.Add(oReader.GetString(0));

OReader.Close();

OConn.Close()

Return DataBaseName;

}//end fn//

  }

}

Tableinfo

{ String TableName;                                                                 {

TableType{                                                                              string columnName;

System=0;                                                                                columnType myType

User=1;