Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old November 10th, 2008, 01: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
__________________
Azizur Rehman
Reply With Quote
  #2 (permalink)  
Old November 10th, 2008, 09: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,190
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
================================================== =========
Reply With Quote
  #3 (permalink)  
Old November 12th, 2008, 03: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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with importing excel to db -ssis collie SQL Server 2005 2 December 1st, 2007 06: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 05:00 AM
Adding the records into Field F1 while importing a jcui@bankofny.com Access 0 August 6th, 2004 01:06 PM



All times are GMT -4. The time now is 06:27 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.