How to use excel sheet as DataBase with CSharp?

Sample code can help you to use excel sheet as database.

private static OleDbDataReader myReader;
private static DBManager dbObject;
public static void readDatabaseDate( string filePath, string selectQuery )
{
  String conString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + filePath + ";" + "Extended Properties=Excel 8.0;";
  dbObject = new DBManager( conString );
  dbObject.open( );
  myReader = dbObject.SelectQuery( selectQuery );
}

Select Query will be "SELECT * FROM [Sheet1$A5:BU65536]".

C# always make our life easy.

Enjoy and say AHO!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s