.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

Read and display the excel data

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

I have 3 excel files having uniqe column Name JobNo. i want to develop a web page containing serach option based on Jobno.

User just type the jobno and press on search button corresponding record should be display on grid view.record may present any of the excel sheet.how can i acheive this.please provide me the code.


View Complete Post

More Related Resource Links

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.

display data in excel 2007


 I am using .net  version 1.1  and  excel 2003 to display data.I need to display data in 2007 .Can  anyone suggest the reference to be added ,connection string change and what should be imported.  

read data from excel

hi all,i had 2 columns in the excel file one is SNo and another Descriptionlooks like belowSno                         Description1                              1/2 Feet2                               1/5 Feet3                              204                               30i read the data from this file using below codestring strFileName = FileUpload1.PostedFile.FileName;            string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" + strFileName + ";" + "Extended Properties=Excel 8.0;";            OleDbC

How to read an Excel file and show data from 2 columns

Hi,I have an Excel file called Products.xls .I have Columns A and B, with the titles NAME and QUANTITY.The name of the sheet is SHEET1.The file has about 40 lines.How do i show these data on a Gridview or Listview ?Thank you.

How do I display excel, pdf and word binary data in a gridview?


Hello forum

I'm using the following code to upload images, pdf files, word files and excel to a sql table as binary data.  However, I can only figure out how to display the images but am clueless about the other type of files.  What adjustments do I need to make so that with a button click I can access the other files?  't By the way, I'm using an image control to display the binary data and I'm aware that that will only work to display images, I just don't how to access all the other types of files once uploaded. Thanks

Imports Microsoft.VisualBasic
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Data.SqlClient
Imports System.IO

Partial Class Uploads_UReceipts
    Inherits System.Web.UI.Page
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Request.QueryString("ImageID") IsNot Nothing Then

            Dim strQuery As String = "select Name, ContentType, Data from tblFiles where id=@id"

            Dim cmd As SqlCommand = New SqlCommand(strQuery)

            cmd.Parameters.Add("@id", SqlDbType.Int).Va

Read data from Excel Document


Hello everybody.

I want to read Excel document using C#. I am not a professional so I need examples to learn the technique. If anyone provides useful link, information, api library, tutorial it will be very helpful to me.

Thank you very much.

Read Data From Excel File


Private Sub DoMSExcel(ByRef ds As DataSet)
            Dim selectConnection As New OleDbConnection
            selectConnection.ConnectionString = ("Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & Me.myFilePath & "; Extended Properties=""Excel 8.0;""")
                enumerator = Me.TablesMapped.Keys.GetEnumerator
                Do While enumerator.MoveNext
                    Dim dataSetTable As String = Conversions.ToString(enumerator.Current)
                        Dim sourceTable As String = Conversions.ToString(Operators.ConcatenateObject

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;

Easy way to read data from an excel sheet using Sql Server

Using this code sample you can easily read the data from the Excel spread sheet into your database table. For code sample please click on the "View Complete Post"

Display data in gridview dynamicallay

I have AD domain which has 100000 users, I want to display all the users in gridview controls.Actually it is displaying users in gridview after parsing entire domain which takes around 30 min. I want to display the users while loading itself.It is continously getting user information from AD domain and getting each user details, I want to display the users information which already queried instead of waiting till getting all users information

asp.net display data in gridview

i want to display data in gridview binded to a sql datasource
but the problem part is i want to bind a field of that datasource to a dropdownlist and when a item is selected in that dropdownlist then correcposnding to that data will be displayed in gridview...

Display Related Data in an ASP.NET GridView

Typically when you display a datagrid you will want to show data from a related table. There are 3 different ways to accomplish this with NetTiers. You can use a custom stored procedure, deepload functionality from the code behind, or a strongly typed datasource control. We'll provide an example of each

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.

Read Excel file from Web Application (C#)



I have a web app where user uploads a file.

File is saved in server locally and I want to read some data from it.

Currently my development  server has office 2003.

So do I need office 2007 in order to be able to  read an excel from office 2007 ?

What are other requirements  ?

I tried a test, using

Microsoft.Office.Interop.Excel.Application excelApp = new Microsoft.Office.Interop.Excel.Application();
Microsoft.Office.Interop.Excel.Workbook wrkBook; // = new Microsoft.Office.Interop.Excel.Workbook();

wrkBook = excelApp.Workbooks.Open(@"C:\www\excel_files\b.xls", ....);

But When trying to open the file I get the error:

Exception from HRESULT: 0x800A03EC

So I'm wondering what I'm missing.


delete data in excel sheet



           I have write the code for deleting the data in excel sheet. but we have got the error" Deleting data in a linked table is not supported by this ISAM."

     below I paste some code snippest.

string strDelete = "Delete  from [" + strSheetName + "$]";

            cmdExcel.Connection = con;
            cmdExcel.CommandType = CommandType.Text;
            cmdExcel.CommandText = strDelete;


Please can anybody this answer.It is urgent

How to read value of CheckBox in EXCEL sheet


I am using OLEDBConnection (@"Provider=Microsoft.ACE.OLEDB.12.0;") to connect to the EXCEL file and read contents. When I read the contents, I get all the contents from the excel sheet but i dont get contents for checkboxes placed inside.

My Excel sheet contains set of checkboxes and I need to know If they are checked or not.These checkboxes are controls which are added from Developer tab in EXCEL.

I dont want to use Excel Assemblies for reading contents as it is not recommended. And also i am using OLEDBconnection and want to stick to this .

Awaiting replies from you guys. Thanks in Advance.

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

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