Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 9th, 2006, 10:40 AM
Authorized User
Join Date: Aug 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default Opening Excel file

hi ther;
please tell me how to open Excel file in asp.net.
The file is on different server
if the file is on localhost it is possible to open it but how it can be done when that file located somewher else?????
Old January 21st, 2006, 01:54 PM
Registered User
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sanajmshaji Send a message via Yahoo to sanajmshaji

Create a data grid and name it as dg and add the following code to Load event of the web page
It will work fine and see the result

Dim connstr As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\datatest.xls;Extended Properties=Excel 8.0;"
        Dim objConn As New OleDbConnection(connstr)
        Dim objadap As New OleDbDataAdapter("SELECT * FROM Range1", objConn)
        Dim ds As New DataSet
        objadap.Fill(ds, "ExcelData")
        dg.DataSource = ds.Tables(0).DefaultView


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening an excel file with VBA TwEaKFrEaK Excel VBA 6 May 23rd, 2014 12:08 PM
Problem in opening excel file in MS Excel 2000 kallol Visual C++ 0 November 16th, 2007 05:48 AM
Opening an Excel file in OWC10.AxSpreadSheet ashu_from_india Visual Studio 2005 0 May 31st, 2007 06:32 AM
Opening Modifying Printing excel File alireza Excel VBA 3 November 18th, 2006 12:59 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.