Click here to Skip to main content
13,865,707 members
Rate this:
Please Sign up or sign in to vote.
See more:
I need to obtain and show the data that is in the DataTable

What I have tried:

DataTable dt = new DataTable();
                        conString = string.Format(conString, excelFile);

                        using (OleDbConnection connExcel = new OleDbConnection(conString))
                            using (OleDbCommand cmdExcel = new OleDbCommand())
                                using (OleDbDataAdapter odaExcel = new OleDbDataAdapter())
                                    cmdExcel.Connection = connExcel;

                                    DataTable dtExcelSchema;
                                    dtExcelSchema = connExcel.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);

                                    //Read Data from Specific Sheet And Range 
                                    cmdExcel.CommandText = "Select * from [" + "5.2" + "$A6:R100000]";
                                    odaExcel.SelectCommand = cmdExcel;
Updated 11-Oct-18 10:00am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Well, identifying the goal is halfway to solving the problem.

Use intellisense to determine what method/property to use to "show the data". I would give you more guidance, but I don't have any skills regarding mind-reading and other associated technologies.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Cookies | Terms of Service
Web06 | 2.8.190214.1 | Last Updated 11 Oct 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100