.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

Excel Upload

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

Dear All,

I have created one program based on DTS which will upload the excel file in SQL Server. I am searching from couple of days to check the column name heading.

If user has missed any column system should show the message "Columns are not matching" please help


Dim extension As String = System.IO.Path.GetExtension(File_Upload.PostedFile.FileName)If extension <> ".xls" Then
Response.Write("<script language='javascript'>alert('You can upload only excel file');window.location.href='R1825_FR_Macess_Upload.aspx';</script>")
File_Upload.SaveAs(Server.MapPath("Load_Master") & " \ R1825_FR_MACESS_FILE.xls")
End If

View Complete Post

More Related Resource Links

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 

excel upload large no of rows


hi all 

i am trying to upload an excel to an oracle data base (10g xe) the excel has arround 46000 rows.

I am getting the following error when i do a insert

ORA-06550 string 1 line 1,

PLS-00123: program too large (Diana nodes)

can some body please help 

thanks abhi

On excel sheet upload read the workbook and populate data to sharepoint list


Requirement in my current project:
In a document library when I upload an excel sheet, a specific workbook has to be read and the contents have to be uploaded to a sharepoint custom list.
The approach followed was create an event receiver and register as a feature. Following is the code for event receiver.

public override void ItemAdded(SPItemEventProperties properties)
            var list = getSPList("{150301BF-D0BD-452C-90D7-2D6CD082A247}");          
            SPListItem doc = properties.ListItem;
            doc["Msg"] = "items deleted from req list";
            string excelname=doc.File.Name;

Connection time out + excel file upload + ajax async as a fix?


Thank you in advance for taking the time to read this.

I have a C# ASP.NET page that allows users to select 2 excel files from their machine and click a button to compare and look for differences.  Any difference is output to a gridview for them to review.  The code works brilliantly on my machine, on other machines inside our network, ect but when we try to access this page from outside the network and use excel file sizes around 1mb a piece, we're seeing a connection timed out error in IE (v6 and v7).

Due to limitations beyond my control, I can not save the files to the server first and then do my comparison code.  Instead I have to read the files to memory and am using a .dll found here, http://exceldatareader.codeplex.com/.  It basically reads the excel files into datasets, which are then passed on to my comparison method.

What appears to happen is that the comparison code takes some time, depending on the file size.  For example, 20kb Excel files net results with no errors in just a few seconds.  200kb files take longer but still succeed.  1mb files, though, get the connection timed out but only in IE and only outside our network.

So my thought was that perhaps the browser isn't getting the results back from the server fast enough and issues the connecti

upload excel file to sql table


i tired a lot of correction, in the end i end up fully used the completely same code and guide of this link.


that was a well step-by-step guide through.

the error i get was, i found out it didnt save the file into table.
from the table under the file column
it show

if i click on download the file
error code shown,
There is no row at position 0.

Source Error:
Line 111:        Dim bytes() As Byte = CType(dt.Rows(0)("file1"), Byte())

can anyone teach me? thanks..

Upload Excel 2010 to IIS7 through ASP Net MVC 3.5


Hi, I'm facing the following problem while trying to upload xlsx 2010 file to 32bit Windows Server 2008, IIS7.

I have a MVC web page, where I'm allowing the user to upload excel files. The old story happened again: it worked fine in locally, but it didn't in prod server.

First, the server was not allowing any excel file at all. And they were not reaching the "Application_BeginRequest" on global.asax so I could log the error, the page just remained loading and then finally throwed "Internet Explorer cannot display the webpage" message.

Then I tested to upload txt files and they worked, so I installed "AccessDatabaseEngine.exe" in the server and it started to recognize xls files, but it didn't recognize xlsx 2010 files.

I installed Office 2010 in the server. and it now recognizes the xlsx files only if I browse the site from inside the server, by typing either "localhost/mySite" or "IpAddress/mySite". But if I browse the site from outside the server, it dioesn't recognize the files. "Application_BeginRequest" is not reached.

Any idea what can I try???

Thanks in advance.

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.

Excel Automation in .Net

Excel Automation is a buzz word in both webapps and winapps. In the programming life (like Mr.Anderson neo) I guess almost every one could have come across this word. For others let me go further in detail. Excel Automation is automating some or all of the process involved in creating or updating excel worsheets.

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

display data into GridView from excel sheet

I have to display data from excel sheet into my gridview and also I need to figure out a way to store data into excel files from my web page. I am using C# 3.5, VS 2008.

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.

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Create And Run Excel Macro At Runtime in C#

You've been tasked with writing a Windows Form application using the .NET Framework that interacts with Microsoft Excel. If you are new to working with Excel in .NET and are having trouble learning how to format certain cells or cell ranges, then this little tip will come in handy. Rather than scour the internet hoping to find the correct set of constants or method syntax for formatting your spreadsheet, use the built in tools in Excel to write the familiar VBA code for you. Then, you can paste the VBA code generated by Excel into the sample C# code below and run it dynamically at runtime.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

Gridview that exports selected rows to Excel

his seems like a messy workaround, but I ended up using two Gridviews - one to display my data and show my checkboxes, and the other which was invisible amd would eventually end up as my Excel spreadsheet.
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