.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Export millions of records from database (Oracle) to excel

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net

Hey guys, I'm running a query that brings millions of records and makes the server run out of memory. I'm thinking I should get the data in chunks. So I was wondering if someone could shed some light on this or point me to another place where I can read further.

Currently, I just implemented "paging". I can now pass a "page index" parameter and "page size". So I could call 1,000 times the stored procedure with a page size of 1,000 (for 1 million records). This might be an option, but I wanted to hear someone else's opinion on how to "stream" records from oracle to the web server and then to a file.


View Complete Post

More Related Resource Links

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

How to do wide search and export the records to excel file in ASP.net C# ?


This is my MYSQL  database connection :-

public static OdbcConnection Connection = new OdbcConnection("Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=jdmcrm; User=root;Password=admin;");

My table name is "customer" and  fields liek customerId , companyName , address and date ;

How to do wide search and export the records to excel file ? im quite new in asp.net .

Pls advise . Thanks





Excel Services to Oracle database

  We've set up a Sharepoint 2010 system on Windows Server 2008 R2. I'd like to set up Excel Services, so we can create dashboards to our back-end databases, which are Oracle. I'm struggling to get the data connection to work. To do this, should I be setting up my DSN with the 32-bit ODBC Oracle drivers, or the 64-bit ODBC Oracle drivers? Looking at the Excel Services setup, I think that the the list of trusted data sources provided are the 32-bit ODBC drivers. I did install the 32-bit ODBC oracle drivers, and set up the DSN I needed. When I log in to the Sharepoint server via RDC and load the Excel spreadsheet, the data connection works fine. But, when I use Excel Services to create a dashboard, and refresh the data connection, I get "Unable to refresh data for a data connection in the workbook." Looking at the Sharepoint log files, I see (password removed): The Connection Information is invalid: ConnectionString: DSN=nifoem;UID=sp_oem;PWD=[XXX];SERVER=nifoem;, CredentialsMethod: Integrated, SSOApplicationId: , QueryType: Odbc bd9d6ef3-6097-4ed5-9b8a-ffafc3997d26 Any idea what I might be doing wrong here? Thanks, John  

Problems Connecting Excel Services to Oracle Database


I am just beginning to experiment with using Excel Services with BI Dashboards in SharePoint 2010.  I created a Excel Workbook that has a data connection using connection type of OLE DB Query with a connection string of "Provider=MSDAORA.1;User ID=<username>;Data Source=<oracleEnvironment>".  I have the Excel Services Authentication Settings set up for a specific SSS ID <mySSSID>.


This Excel Workbook has been Saved to SharePoint with an entire sheet published.  The Excel Web App is displaying the sheet and the Slicers are functioning just like they do in the Excel client.  When I refresh the data on the client I get prompted for a password and it works fine.  When I refresh on the Web App I have received a variety of errors depending on what I try but nothing has helped me track down what I have missed.

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Database Export Wizard for ASP.net and SQL Server

A step wizard for ASP.net to export database objects to CSV, TXT, HTML, XML, or SQL. it guides users through a few simple steps to choose a database object (table, view, or query), select columns, and export the data in any of the standard formats CSV, HTML, XML, or SQL.

Need Oracle Data Provider .CS File for Oracle 10g Database connection !



I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query


Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");


Plz Post the link if there is any open source !    

Export Gridview data to Excel sheet


Hi ,

     I have a requirement where i need to export the gridview data to excel.My code export the data in excel that was fine.

But the enchancement needed now , I was exporting the 3 gridview in same excel sheet under the workbook.

Now i need to export the 3 grid view in 3 different sheet in the same workbook.

so can please tell or share the updated code in my below code ...

public void writeovrsummary()


        Response.Write("Overall Summary");
        //Response.Write("Report as of " + DateTime.Now.ToString("hh:mm ss tt"));

        StringWriter sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        SqlCommand com = MyConnection.CreateCommand();
        com.CommandText = "useroverall_Report";
        SqlParameter[] par = new SqlParameter[1];
        par[0] = new

Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

access Oracle database


Pre- .Net Framework 4.0 supported using Oracle.DataAccess.Client, using Oracle.DataAccess.Types, System.Data.OracleClient, OracleDataReader, OracleConnection. What are the equivalents in .Net Framework 4.0? Does it require any download?

Thank you.

How to save records with autogenerated html links in Sql database?


Hi I would like to create a database where users can search for multiple fields. For example: if the record is personal details info like name, address, phone number and email id i would like to generate link for this automatically with the fields using stored procedure.. Is that possible.? If so can anybody provide me with the line of code or guideline on how to do that?

Any help much appreciated. Thanks

export to excel issue


Hello ,

I have a browser enabled form which i published to sharepoint ..now i want to export the contents of the form to excel..i have 1 repeating table and two repeating sections ..whenever i go to export to excel and then choose just one repeating table or a repeating section or any option other than export all form data i get an error ...first the progress bar just freezes and then when i end the task through task m anager i get a msg that microsoft excel could not start.make sure excel is installed correctly and then try again....

Can somebody tell me how to debug this..i have tried the export of a form containg repeating table and sections and it works good ..so that means there is some problem with my form..so now can somebody give me an idea as to what can the problem be and how can i debug it.


ASP.NET Excel Export Issue



I am trying to export data from SP to a .xlsx sheet. Total no of rows is more  than 15000 with total of 13 columns.The data is generated with the help of SQL Server SP. Till this point it is working fine. However while exporting to excel I do not get any data , the excel  has blank content.

If I have records less than 12000 it generated the excel report with  relevant data. However as row increases the report is blank.

Also the excel is generated through the code but when I deploy to server and try to generate it generates a blank excel. 

 Please advice what needs to be done. I have tried multiple options but none works.

Export altered gridview to Excel


Hello... stuck on this one!!  In a gridview RowDataBound named gvwResult I am altering one of the cells with a value retrieved from the query.

I have added:

if (hdnExchangeTo.Value.ToString() != "1")
            for (int i =0; i < gvwResult.Rows.Count; i++)
                gvwResult.Rows[i].Cells[7].Text = ExchangeCurrency(gvwResult.Rows[i].Cells[7].Text.ToString());

to the common code to export to Excel:

        Response.Buffer = true;
        Response.Charset = "";
        Response.ContentType = "application/vnd.ms-excel";
        System.IO.StringWriter sw = new Syste

insert new records in tables from dataset to database


I have 2 tables in SqlServer 2008.

Table1: T1id, SomeData

Table2: T2id, T1id, SomeData

I am using DataAdapter.FillSchema to create shema of tables in DataSet. I created DataRelation on columns T1id in both tables.

Now when i try to Update Sql Database T1id in Table2 remains 0 and not the value of T1id in Table1.

I can successfully update Sql Database if i fill DataSet with records first (Using DataAdapter.Fill), but that's not what i want to do. I don't need "old" records in my dataset. I want to use dataset just to store all imputs from user until the proccess is done and then insert all those records "at the same time".

I think i'm getting it wrong with ForeignKeyConstraints, maybe UpdateRule is not set to cascade, i just don't know.

I have been trying to work this out for 6 days now and i'm about to break something on half.

Can someone please guide me to right direction, maybe post some sample, anything.... please!

My old post regarding this:

How to update Sql Server related tables from Dataset(SchemaFill)

SqlDataAdapter.Update related tables

Insert Excel Data via File Upload into sql server database???

Hi all, I have requirement that User can Upload the Excel Sheet Data to sql server Database at once. How i do that Any Article or hint is apperciated.   Regards 

Export to Excel

How can  I create hidden columns in SQL Server Reporting Services 2005 to be rendered as excel? Thanks in advance
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend