Databases :: Page Times Out Reading Excel File?
Mar 31, 2010
I have some code that reads records from an excel file and then imports that data into an sql database. The issue only happens when the excel file has more then 350 rows in it. In the middle of the import it just stops executing and I get directed to the 'Internet Explorer cannot display the webpage' page or just a blank page when using firefox.
I dont get any time out errors or any error at all but still I tried messing around with the script timeout settings but still does the same thing at about the 2 min 30 sec mark.
[Code]....
View 2 Replies
Similar Messages:
Nov 19, 2010
I understand how to use a connection string object to read excel sheets. What I don't know is how to follow a hyperlink inside excel, grab matching data from the linked page and return it to my database. Essentially, the spreadsheet has two columns:
Title | Class#
Class# has the hyperlink which links to an internal web site. The connected page has a course description and any pre-required classes that must be taken before you can take this class. This is where I'm rather stumped as I've not had to do this type of thing before.
View 4 Replies
Aug 31, 2010
I need to be able to read an excel file from a file upload control but I can not save the file to disk first, it must be done in memory.
[Code]....
Above is my code for reading the data file if it IS saved to disk, but again, I have to be able to do this without saving the file to disk, it must be done in memory. I have not been able to find any sample code anywhere on how to do this from memory, everything seems to force the file be uploaded, saved to disk, and then read in the connection string, which again I can not do.
View 2 Replies
Jun 8, 2010
in my application i have to read from an excel files and check the value of every cell i'm using an OleDb connection to open it and reading but i have this issue if some of the cells in the excel sheet is having this warning when i try to read it returns DBNull ??could any one give me a clue ....knowing that i can not force the user for not having this warning ...i have to solve this within my code .
View 5 Replies
Mar 1, 2011
I have a scenario where I have to read an excel file to dump records in a mysql database. The code generates an exception Sheet1 not found. I have pasted the code below. Please let me know the solution to the exception. I have given the correct read/write/modify settings to my excel file.
if (fileUpload1.PostedFile.FileName.EndsWith(".xls") || fileUpload1.PostedFile.FileName.EndsWith(".XLS"))
{
string fileName = Server.MapPath(fileUpload1.PostedFile.FileName);
string connString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + fileName + ";Extended Properties=Excel 8.0";
// Create the connection object
OleDbConnection oledbConn = new OleDbConnection(connString);
try
{
// Open connection
oledbConn.Open();
// Create OleDbCommand object and select data from worksheet Sheet1
OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]" , oledbConn);
// Create new OleDbDataAdapter
OleDbDataAdapter oleda = new OleDbDataAdapter();
oleda.SelectCommand = cmd;
// Create a DataSet which will hold the data extracted from the worksheet.
DataSet ds = new DataSet();
// Fill the DataSet from the data extracted from the worksheet.
oleda.Fill(ds, "RestaurantExcelData");
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
Response.Write("Data: " + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "");
}
}
catch(Exception e1)
{
}
finally
{
// Close connection
oledbConn.Close();
}
}
else
{
Response.Write("File Not Excel (xls||XLS)");
}
View 2 Replies
Sep 23, 2010
Using C# to develop an application.I need to upload data ( which is in excel) to a sql table.
[Code]....
View 1 Replies
Aug 3, 2010
I am attempting to read data from an uploaded spreadsheet using ACE.OLEDB. The code, which is running fine on dev and test machines for XL2003/2007 reports "Exernal table is not in the expected format" error on connecting on the production server for XL2007 only.The code is
Dim connectionString As String = "provider=Microsoft.Ace.OLEDB.12.0;" _ & "Data Source='" & ImportData.FullName & "';Extended Properties=Excel 12.0;" LogWebActivity.LogThis("Entering POPSUKD, ConStr=" & connectionString, LogWebActivity.LogDetailLevel.DetailAndData) Dim con As New System.Data.OleDb.OleDbConnection(connectionString) LogWebActivity.LogThis("Dimmed con", LogWebActivity.LogDetailLevel.Debugging) Try Dim cmdSelect As New System.Data.OleDb.OleDbCommand("SELECT * FROM [" & WorksheetName & "$]", con) Dim adapter As New System.Data.OleDb.OleDbDataAdapter(cmdSelect) Dim dS As New Data.DataSet LogWebActivity.LogThis(cmdSelect.CommandText, LogWebActivity.LogDetailLevel.Debugging) con.Open() LogWebActivity.LogThis("Opened Connection", LogWebActivity.LogDetailLevel.Debugging) adapter.Fill(dS, WorksheetName) LogWebActivity.LogThis("Filled DataAdapter", LogWebActivity.LogDetailLevel.Debugging) _SKUS = dS.Tables(WorksheetName) LogWebActivity.LogThis("Set SKUS", LogWebActivity.LogDetailLevel.Debugging)
View 1 Replies
Mar 4, 2011
Want to create a web based application for reading and writing excel files.
Issue :
1. Want to upload an excel file and store it some location.
2. Read data from excel file, performing some sorting and filtering
3. Write filtered data to new excel file.
View 1 Replies
Nov 8, 2010
My web app is allowing the user to load a column of data from an Excel spreadsheet. For whatever reason, as it parses the data, fields that are just integers are coming up as System.DBNull. (Code in VB.NET but I work with C# as well, so feel free to post C# solutions)
[Code]....
dataRow(0) is System.DBNull when the Excel file has a number in Column A. Here's what the Excel looks like
Column A
100S200
WEIRD
ABCDEFG
123456
100S12791
119655902
100S12792
105E17530
123456 and 119655902 come through as DBNull
View 8 Replies
Mar 29, 2010
I am trying to export a grdview to an Excel file but I am getting this error and i suspect
the error has something to do with the fact that the code is on a CONTENT page and not web page:
[Code]....
Here is my export code:
[Code]....
So I trying adding this code to avoid the error but this has a problem with a content page:
[Code]....
[Code]....
View 1 Replies
Jan 12, 2011
i like to create a web application,in that i need to get the resumes from the user,then i need to publish that resume to the manager in date wise..
View 5 Replies
Nov 29, 2010
I have tab delimited .xls file. I want read this to a dataset. Oledb connection string is given below. But i'm getting one error on objConn.Open();
string strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filepath + ";Extended Properties=Excel 8.0";
OleDbConnection objConn = new OleDbConnection(strConn);
objConn.Open();
Error : External table is not in the expected format.
How can i read tab delimited .xls file to a dataset using oledb connection?
View 5 Replies
Jul 8, 2010
I'm trying to read data from a text file into a DataReader object using the following code but I get an exception:
OleDBException was unhandled.
Cannot update. Database or object is read-only.
Also, I would like to know if it is efficient to read data of a text file into a datatable instead of using StreamReader object and traversing through the recordset.
[Code]....
View 3 Replies
Mar 4, 2010
1) I need to make reading CSV file from the fileupload and then retrieve the data.
2) I need to load CSV and the 3 columns rise two functions.
Load CSV data and then stored in a database, but I need to save storage space vary according to 3 column.
CSV Example:
1 column - Cat, 2 column - Black, 3 column - 1
1 column - Dog, 2 column - Brown, 3 column - 2
1 column - Cat, 2 column - Black, 3 column - 1
1 column - Dog, 2 column - Brown, 3 column - 2
Now I need to load the CSV in C # and column 3 to distinguish what the operation is carried out.When the load line in column 3 contain the value 1, so will save the table 'Cats' when the value 2 and is saved in the table "Dogs".(Note: Data are separated ";")
View 4 Replies
Apr 8, 2010
In my application, i have one fileupload control which will take excel file. I want to read this excel file and want to store in datatable. How will i do this. I am using visual studio 2008.
View 8 Replies
May 27, 2010
I am reading a CSV file created by Excel. the string I am reading needs to be encoded (it shows small boxes instead of hebrew characters) so I wrote a lil routine to convert the string -
Function encodeName(ByVal name As String) As String
Dim src As Encoding = Encoding.UTF8
Dim dest As Encoding = Encoding.Default
Dim srcBytes() As Byte
srcBytes = src.GetBytes(name)
Dim asciiBytes() As Byte = Encoding.Convert(src, dest, srcBytes)
Dim mychars(dest.GetCharCount(asciiBytes) - 1) As Char
dest.GetChars(asciiBytes, 0, asciiBytes.Length, mychars, 0)
Dim asciiString As New String(mychars)
End Function
From what I read FileStream.ReadLine reads the text with encoding UTF8 so I try to convert from UTF8 to Encoding.Default buy instead of little boxes I get question marks.
View 2 Replies
Sep 22, 2010
I am reading an excel file in C#.NET. The data is being read successfully but there is problem with some hyperlinks stored in the excel file. I can read their text but i dont know how to get the underlying link/url of the column. I couldnt find much help on google as well. if someone has worked in a similar situation please let me know what can be done.edit::: i am using OleDb namespace for establishing a connection with the Excel file so if someone can post a solution which applies to this situation
View 1 Replies
Dec 5, 2010
I am trying to import the excel file whose format is not in row column order in asp.net 3.5
I tried to read the file using OleDBDataAdapter but it given me the error "External file is not in proper format" something like that..
View 2 Replies
Jun 28, 2010
I have a way to read and excel file, see below,
[Code]....
But some times the file that is read, reports that there is more rows than there actually are. i.e. I only have 300 lines of data but the read reads in 500. My question is, and I am sure I have seen this somewhere but I cannot find it now, is how do I get the reader to stop reading at the first blank line?
View 2 Replies
May 24, 2010
I am using reading data from excel file and inserting into sql server using following article, it seems to be working correctly except when I do page refresh normally, it again execute the the btnUpload_click. I want that once the record imported and if user refresh the page again it should ask for enter file name again. let me know how do I resolve this? [URL]
View 8 Replies
May 18, 2010
I need a code which can export the data from XML file to the Excel file.
View 3 Replies
Mar 18, 2011
We have an MVC application where we have put an excell loader. It works fine in the VS studio environment but on the IIS (64 bit) we get an error message .->
Microsoft.ACE.OLEDB.12.0 provider is not registrated on the local machine.The excell (2010) is 32 bit, but the IIS is 64 bit. Here the code
[Code]....
View 2 Replies
Mar 18, 2011
Not sure how to best accomplish this task. I do have several reports to make in Excel every day. The reports do have a shhet for every week and one column for each day in week. What is the best way to get the excel auto update and get data from the SQL table? As for now I run a query on a webpage and coying the data in to the excel sheet manually. Should I try making a database connection within the excel sheet? Should I try having a ADO connection working in .NET? I really donīt know where to begin.
View 2 Replies
Sep 27, 2010
I have to create one page where user will upload the excel file in SQl Server and system should check following things
1.Sheet Name should be always sheet1
2.System should check the column names
3.System should show the message that these many rows has been loaded
View 1 Replies
Nov 11, 2010
i can't read picture from file excel in code asp.net
View 2 Replies