Yes, just as you mentioned, I'm trying to call OleDbDataAdapter's Update but I get this error
---------------------------------------------------------------------
System.InvalidOperationException: Update unable to find TableMapping['Table'] or DataTable 'Table'.
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet, String srcTable)
at System.Data.Common.DbDataAdapter.Update(DataSet dataSet)
at TPApplication.frm_main.ReadExcelFile(String fileName) in c:\...
---------------------------------------------------------------------
Here is my code to read the data from Excel
---------------------------------------------------------------------using System.Data.OleDb;
string strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = c:\\Test.xls;Extended Properties=Excel 8.0";
OleDbConnection myConn = new OleDbConnection(strCon);
string strCom = " SELECT * FROM [Sheet1$] ";
myConn.Open();
OleDbDataAdapter myCommand = new OleDbDataAdapter(strCom , myConn);
DataSet inputDataSet = new DataSet();
myCommand.Fill (inputDataSet, "[Sheet1$]");
myConn.Close();
dtg_input.DataMember= "[Sheet1$]";
dtg_input.DataSource = inputDataSet;
// Some changes made in the datagrid, and I wana save the changes
**************Error*********************
myCommand.Update(inputDataSet);
****************************************
Thankz again...
--
Message posted via
http://www.dotnetmonster.com