I have a excel file and I want to find what I need the ID which is first colomn. The excel file is 4 sheets and fisrt colomn is ID on them. Problem is this :
I know only and only ID but I dont know this ID which sheet and which row so I must be search it all 4 sheets and rows then I will found it because I need to delete this row.
For example : My Id :123 it is 8th row and 3th sheet so i must be find 3th sheet and find 8th row and will delete...
Thank you for your attend...
darkocean 1 Junior Poster in Training
Recommended Answers
Jump to PostDo you want to do this with Excel automation (Interop) or with OleDb?
Jump to Postusing System; using System.Collections.Generic; using System.Data; using System.Data.Common; using System.Windows.Forms; namespace daniweb { public partial class frmOleDdXlsSearch : Form { public frmOleDdXlsSearch() { InitializeComponent(); } private static string BuildExcelConnectionString(string Filename, bool FirstRowContainsHeaders) { return string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='{0}';Extended Properties=\"Excel 8.0;HDR={1};\"", Filename.Replace("'", "''"), FirstRowContainsHeaders ? "Yes" : "No"); } private …
Jump to PostI can't compile that code, i'm missing a definition for
Sistem sistemim = new Sistem();
I do see the problem though:using (DbConnection conn = factory.CreateConnection()) { conn.ConnectionString = connStr; conn.Open();
The
conn.Open()
actually opens the excel file and locks it. The OleDb provider has …
Jump to Post..and what does Teknoser mean? Its a funny sounding word to me :)
Jump to PostYou're welcome and please don't forget to mark this thread as solved if the solution works for you!
Good luck :)
All 17 Replies
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
darkocean 1 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
darkocean 1 Junior Poster in Training
sknake 1,622 Senior Poster Featured Poster
darkocean 1 Junior Poster in Training
darkocean 1 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.