Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2008, 02:35 AM
Registered User
 
Join Date: Sep 2007
Location: Hyderabad, A.P, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem , importing thousand records from Excel

Hi,
    i'm facing problem while importing thousands of records from excel file into dataset.
i'm able to import only 3500 records. please help me to read or import more records from excel into dataset.

Azizur Rehman
 
Old November 10th, 2008, 10:03 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

Can you tell more about the problem??? do you receive an error?? what happens after that quantity of records???

HTH

Gonzalo

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from dparsons signature and he Took that from planoie's profile
================================================== =========
My programs achieved a new certification (can you say the same?):
WORKS ON MY MACHINE
http://www.codinghorror.com/blog/archives/000818.html
================================================== =========
I know that CVS was evil, and now i got the proof:
http://worsethanfailure.com/Articles...-Hate-You.aspx
================================================== =========
 
Old November 12th, 2008, 04:07 AM
Registered User
 
Join Date: Sep 2007
Location: Hyderabad, A.P, India.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ,
[b] while importing thousands of records its showing Blank page .

System.Data.OleDb.OleDbConnection objConn = default(System.Data.OleDb.OleDbConnection);
            System.Data.DataTable dt = default(System.Data.DataTable);
            string strSheets = null;
            int i = 0;
            try
            {
                string ConnString = "Provider=Microsoft.ACE.OLEDB.12.0; " + "data source='" + FileName + " '; " + "Extended Properties=Excel 12.0;";
                objConn = new System.Data.OleDb.OleDbConnection(ConnString);
                objConn.Open();
                //object obj = null;
                dt = objConn.GetOleDbSchemaTable(System.Data.OleDb.OleD bSchemaGuid.Tables, null);
                string strsheet = "Data";
                DataSet ds = new DataSet();

                for (i = 0; i <= dt.Rows.Count - 1; i++)
                {
                    if (strsheet.ToString().Trim() + "$" == Convert.ToString(dt.Rows[i]["TABLE_NAME"].ToString().Trim()))
                    {
                        bool isExistSheet = true;
                        strSheets = dt.Rows[i]["TABLE_NAME"].ToString().Trim();
                        break; // TODO: might not be correct. Was : Exit For
                    }
                    else
                    {

                        //isExistSheet = false;
                        bool bResult = false;
                    }

                }
                string excel = strSheets;
                //if ((objConn.Open()))
                //{
                // objConn.Close();
                //}

                //System.IO.File.Delete(FileName);
                return excel;
            }
            catch (Exception ex)
            {
                return null;
            }
            finally
            {
                //if ((ConnectionState.Open))
                //{
                objConn.Close();
                objConn.Dispose();
                //
                //}
            }

Azizur Rehman




Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with importing excel to db -ssis collie SQL Server 2005 2 December 1st, 2007 07:07 PM
Problem importing XML data to Excel bluerattle XML 2 July 3rd, 2007 03:35 PM
Problem importing XML data to Excel bluerattle Excel VBA 0 July 3rd, 2007 03:34 PM
problem in importing data from excel to sql hiren1977 General .NET 0 January 2nd, 2007 06:00 AM
Adding the records into Field F1 while importing a jcui@bankofny.com Access 0 August 6th, 2004 01:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.