Click here to Skip to main content
15,890,825 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Richard Deeming1-Feb-13 5:36
mveRichard Deeming1-Feb-13 5:36 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Michael†Cheong1-Feb-13 5:58
Michael†Cheong1-Feb-13 5:58 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Michael†Cheong1-Feb-13 7:03
Michael†Cheong1-Feb-13 7:03 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Richard Deeming1-Feb-13 8:12
mveRichard Deeming1-Feb-13 8:12 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Michael†Cheong8-Feb-13 20:10
Michael†Cheong8-Feb-13 20:10 
GeneralRe: Display image using handler.ashx what wrong my code Pin
Richard Deeming11-Feb-13 1:29
mveRichard Deeming11-Feb-13 1:29 
QuestionImagesIn Gridview Pin
m.sutarmahesh31-Jan-13 20:13
m.sutarmahesh31-Jan-13 20:13 
QuestionImporting Excel into Gridview, doesn't import all rows Pin
Craist31-Jan-13 8:29
Craist31-Jan-13 8:29 
XML
I am attempting to import an Excel Spreadsheet (2010, XLSX) to Gridview, then upload to MS SQL 2012 database. There are 30,000 rows in spread sheet approximately. When I run it locally it works just fine. When I put it live on the server it doesn't work properly.

When it is importing into the Gridview it stops at a particular row every time. The row is around 21,000. If I delete the top 10,000 rows from spreadsheet it still stops at that same row. So in other words it doesn't matter if I try 21,000 rows or 11,000 rows it stops at that same one. That tells me it isn't a size or time limit. If I delete the top 16,000 rows and the bottom 5,000 rows. It does go past that record. This tells me the next record doesn't have bad data.

So we know it isn't a size / time issue. We know it isn't corrupt data in the next row. We know the code runs fine locally, but not on server.

I have tried this using datasets and datatables and the results are the same.

Connection String:

string myPath1 = @""+Server.MapPath(".") + @"\"+TextBox3.Text;
string strConn = @"provider=microsoft.ace.oledb.12.0;extended properties=""excel    12.0;HDR=YES"";data source="+myPath1+"";


In web.config I have:

<httpRuntime maxRequestLength="72604736"/>
and

<requestLimits maxAllowedContentLength="72604736" />


GridView code:

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="True" >
</asp:GridView>
Code behind to fill GridView (DataTable)

    OleDbConnection myExcelConn = new OleDbConnection(strConn);
    OleDbCommand myExcellComm = new OleDbCommand();
    OleDbDataAdapter oda = new OleDbDataAdapter();
    DataTable myDT = new DataTable();
    myExcellComm.Connection = myExcelConn;
    myExcelConn.Open();
    myExcellComm.CommandText = query;
    oda.SelectCommand = myExcellComm;
    oda.Fill(myDT);
    myExcelConn.Close();
    GridView1.DataSource = myDT;
    GridView1.DataBind();
Code behind to fill GridView (DataSet) DataSet excelDataSet = new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(query, strConn);

    da.Fill(excelDataSet);

    GridView1.DataSource = excelDataSet;
    GridView1.DataBind();
Again doesn't matter if I use DataTable or DataSet it produces the same thing.

I have verified the spreadsheet that gets uploaded does contain all the data. I have tried using FTP instead of file upload and same results. I have downloaded the uploaded excel file and ran it locally and again it works just fine.

Using Visual Web Developer Express 2010 with all Service Packs and Updates in C# local machine - Vista Ultimate with all updates Web server - VPS Windows Server 2012 with all updates and MS SQL 2012 with all updates.

Does anyone have any idea and where I should look next to solve the problem?

AnswerRe: Importing Excel into Gridview, doesn't import all rows Pin
Craist31-Jan-13 9:22
Craist31-Jan-13 9:22 
QuestionWeb Pages Authentication Pin
Jassim Rahma30-Jan-13 21:22
Jassim Rahma30-Jan-13 21:22 
AnswerRe: Web Pages Authentication Pin
Rahul Rajat Singh30-Jan-13 22:14
professionalRahul Rajat Singh30-Jan-13 22:14 
QuestionAuthentication with database MVC4 Pin
AghaKhan30-Jan-13 20:44
AghaKhan30-Jan-13 20:44 
QuestionAutocomplete List hides behind Grid's horizontal scrollbar Pin
Ponka_developer30-Jan-13 12:01
Ponka_developer30-Jan-13 12:01 
AnswerRe: Autocomplete List hides behind Grid's horizontal scrollbar Pin
jkirkerx30-Jan-13 12:50
professionaljkirkerx30-Jan-13 12:50 
QuestionMessage Removed Pin
29-Jan-13 4:39
professionalN_tro_P29-Jan-13 4:39 
QuestionHow to create and get the user input in alert message in asp.net webservice Pin
Rocky2327-Jan-13 22:22
Rocky2327-Jan-13 22:22 
AnswerRe: How to create and get the user input in alert message in asp.net webservice Pin
Sandeep Mewara27-Jan-13 23:28
mveSandeep Mewara27-Jan-13 23:28 
AnswerRe: How to create and get the user input in alert message in asp.net webservice Pin
Ali Al Omairi(Abu AlHassan)28-Jan-13 3:41
professionalAli Al Omairi(Abu AlHassan)28-Jan-13 3:41 
GeneralRe: How to create and get the user input in alert message in asp.net webservice Pin
Rocky2328-Jan-13 22:13
Rocky2328-Jan-13 22:13 
GeneralRe: How to create and get the user input in alert message in asp.net webservice Pin
Ali Al Omairi(Abu AlHassan)28-Jan-13 22:54
professionalAli Al Omairi(Abu AlHassan)28-Jan-13 22:54 
AnswerRe: How to create and get the user input in alert message in asp.net webservice Pin
jkirkerx30-Jan-13 12:52
professionaljkirkerx30-Jan-13 12:52 
QuestionChange CSS dynamically using javaScript Pin
sonusharma6527-Jan-13 21:36
sonusharma6527-Jan-13 21:36 
AnswerRe: Change CSS dynamically using javaScript Pin
Sandeep Mewara27-Jan-13 23:24
mveSandeep Mewara27-Jan-13 23:24 
Questioncapture the signature from signature pad in Web App. Pin
premaa36@gmail.com27-Jan-13 20:40
premaa36@gmail.com27-Jan-13 20:40 
AnswerRe: capture the signature from signature pad in Web App. Pin
Sandeep Mewara27-Jan-13 21:08
mveSandeep Mewara27-Jan-13 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.