Quantcast
Viewing all articles
Browse latest Browse all 448

New Post: How to switch between sheets

I need to get information from sheet1 "your details" and then sheet2 "your sites"
foreach (DataTable dt in result.Tables)
            {
                if (dt.TableName.ToLower().Contains("your details"))
                {
                    excelReader.Read();
                    ... do stuff
                 }
                 else if(dt.TableName.ToLower().Contains("your sites"))
                {
                    excelReader.Read();
                    ... This is the problem,  I'm still reading from sheet "your details"
                }
But when the code finds the sheet "your sites" and I call [excelReader.Read();] it is still reading from the first sheet...
Can anyone help ?

Viewing all articles
Browse latest Browse all 448

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>