| | |
Read Data From MS Excel 2007
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 4
Reputation:
Solved Threads: 0
hi everybody,
i want to read data from Ms Excel 2007 . So i used this connection string
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;"+"Data Source="+txtFilepath.Text+";"+"Extended Properties=Excel 12.0;";
but it display error :Could not find installable ISAM.
i also installed AccessdabaseEngine.exe
but still display the same error.
please help me
i want to read data from Ms Excel 2007 . So i used this connection string
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;"+"Data Source="+txtFilepath.Text+";"+"Extended Properties=Excel 12.0;";
but it display error :Could not find installable ISAM.
i also installed AccessdabaseEngine.exe
but still display the same error.
please help me
•
•
Join Date: Sep 2007
Posts: 10
Reputation:
Solved Threads: 1
Dear Senpark,
I know its very late to reply this post. But i think it will really helpful to you.
I know its very late to reply this post. But i think it will really helpful to you.
C# Syntax (Toggle Plain Text)
string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Members.xlsx;Extended Properties=""Excel 12.0;HDR=YES;"""; // if you don't want to show the header row (first row) // use 'HDR=NO' in the string string strSQL = "SELECT * FROM [Sheet1$]"; OleDbConnection excelConnection = new OleDbConnection(connectionString); excelConnection.Open(); // This code will open excel file. OleDbCommand dbCommand = new OleDbCommand(strSQL, excelConnection); OleDbDataAdapter dataAdapter = new OleDbDataAdapter(dbCommand); // create data table DataTable dTable = new DataTable(); dataAdapter.Fill(dTable); // bind the datasource dataBingingSrc.DataSource = dTable; // assign the dataBindingSrc to the DataGridView dgvExcelList.DataSource = dataBingingSrc; // dispose used objects dTable.Dispose(); dataAdapter.Dispose(); dbCommand.Dispose(); excelConnection.Close(); excelConnection.Dispose();
Last edited by cscgal; Oct 30th, 2008 at 8:52 pm. Reason: Fixed broken code tags
![]() |
Similar Threads
- wallpaper locked after removing pest trap (Viruses, Spyware and other Nasties)
- Save WinXP (Geeks' Lounge)
- please read and help asap- rundll32 problem (Viruses, Spyware and other Nasties)
- Hijack This log for Buffer Overrun error.. (Viruses, Spyware and other Nasties)
- attach excel content to emails,based on criteria(very urgent) (Visual Basic 4 / 5 / 6)
- help!!! (Viruses, Spyware and other Nasties)
- IE is redirecting to other sites - HJT log attached (Viruses, Spyware and other Nasties)
- Trojan has given start to hell on a poor PC (HijackT Log inside) (Viruses, Spyware and other Nasties)
- Desktop folder shortcuts makes explorer.exe quit, can't double-click (Viruses, Spyware and other Nasties)
Other Threads in the C# Forum
- Previous Thread: BindingSource.EndEdit not updating DataSet
- Next Thread: How to add whole column in combobox
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast button buttons c# check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing editing enabled encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener load mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post print programming radians regex remote remoting resolved. richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer update user usercontrol validation view visualstudio webbrowser windows winforms wpf xml





