5
Answers

Bulk Import And Export

Gautam Parmar

Gautam Parmar

7y
203
1
I have more than 90k Record in my table, I want to Import it to excel and give to client when they click download button from website, I have tried some code which takes too much time or more than 30 min.
 
I have tried to export record from directly SQL using Stored Procedure but it gives different errors which I have no idea what it is actually because I tried to search a lot.
  1. Msg 7399, Level 16, State 1, Line 2  
  2. The OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)" reported an error. The provider did not give any information about the error.  
  3. Msg 7303, Level 16, State 1, Line 2  
  4. Cannot initialize the data source object of OLE DB provider "Microsoft.Jet.OLEDB.4.0" for linked server "(null)".  
Basically, I want to know what is the best way to import and export from SQL to excel when data is more than 1lc Record.
 
I am Using C# Web API With Angular And Sql 2012
Answers (5)
0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 527k 15y

Your aspx page should look like this. You should call the javascript function on top of the page like below. Try this. You also can send the code.
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditProfile.aspx.cs" Inherits="Contents_EditMyProfile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html xmlns="
http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test</title>
      <script type="text/javascript" language="javascript">
       function colorchange()
        {
            alert("test");
        }  
             
    </script>
</head>
<body bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0" class="body" onload="EditProfile_onload()">
    <form id="frmEditProfile" runat="server">
        <table cellpadding="0" cellspacing="0" width="900px" border="0">
            <tr align="left" valign="top">
              <td></td>    
            </tr>
         
        </table>
    </form>
  </body>
</html>
0
Abhay Mhatre

Abhay Mhatre

NA 29 0 15y
this is not working with my code. do you want to see my code?
0
Niradhip Chakraborty

Niradhip Chakraborty

NA 6.5k 527k 15y

To call a java script function from server side you can use the following code,and inside the javascript function you can call other javascript function.
Page.ClientScript.RegisterStartupScript(this.GetType(), "", "ColorChange();", true);