ADO Problem fro extracting excell data
Hi
I have some problem with extracting excell data. It alwasy miss the first row. Any one have any Idea what is the problem? Is it a DOTNET bug?
**********CODE***************
String temp="Select * From ["+ this.txtSheet.Text+"$"+this.txtStarting_cell.Text+ ":"+this.txtEnd_cell.Text+"]";
String path=this.txtSaveF.Text;
String temprec;
System.Data.DataSet DS;
System.Data.OleDb.OleDbDataAdapter MyCommand;
System.Data.OleDb.OleDbConnection MyConnection;
MyConnectHi
I have some problem with extracting excell data. It alwasy miss the first row. Any one have any Idea what is the problem? Is it a DOTNET bug
**********CODE***************
String temp="Select * From ["+ this.txtSheet.Text+"$"+this.txtStarting_cell.Text+ ":"+this.txtEnd_cell.Text+"]";
String path=this.txtSaveF.Text;
String temprec;
System.Data.DataSet DS;
System.Data.OleDb.OleDbDataAdapter MyCommand;
System.Data.OleDb.OleDbConnection MyConnection;
MyConnection = new System.Data.OleDb.OleDbConnection( "provider=Microsoft.Jet.OLEDB.4.0; " +"data source=" +this.txtOpenF.Text + "; Extended Properties=Excel 8.0; ");
// Select the data from Sheet1 of the workbook.
MyCommand = new System.Data.OleDb.OleDbDataAdapter(temp, MyConnection);
DS = new System.Data.DataSet();
MyCommand.Fill(DS);ion = new System.Data.OleDb.OleDbConnection( "provider=Microsoft.Jet.OLEDB.4.0; " +"data source=" +this.txtOpenF.Text + "; Extended Properties=Excel 8.0; ");
// Select the data from Sheet1 of the workbook.
MyCommand = new System.Data.OleDb.OleDbDataAdapter(temp, MyConnection);
DS = new System.Data.DataSet();
MyCommand.Fill(DS);
|