i have a project school managment system..
i want to copy all excel data to the project because most of the college maintains their record in excel...........
i used msaccess database............
plz provide me some help...
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Hirendra SisodiyaPosted Mar 19, 2010, 1:23 AM
System.Data.OleDb.OleDbConnection MyConnection ;
System.Data.DataSet DtSet
System.Data.OleDb.OleDbDataAdapter MyCommand ;
MyConnection = new System.Data.OleDb.OleDbConnection("Connection String");
// put our connection string on the place of "ConnectionString" for more information of excel connection string try this link: http://www.connectionstrings.com/excel
//and suppse that Sheet1 is your spreadsheet name
MyCommand = new System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection);
MyCommand.TableMappings.Add("Table", "TestTable");
DtSet = new System.Data.DataSet();
MyCommand.Fill(DtSet);
MyConnection.Close();
now you can save dataset in to access database easily.
thanks
mark as answere if you like my answere