Subject: Opening Excel file
Posted By: p2pMember Post Date: 1/9/2006 9:40:22 AM
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?????
Reply By: sanajmshaji Reply Date: 1/21/2006 12:54:19 PM
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
        objConn.Open()
        objadap.Fill(ds, "ExcelData")
        dg.DataSource = ds.Tables(0).DefaultView
        dg.DataBind()
        objConn.Close()




sanajmshaji

Go to topic 39008

Return to index page 389
Return to index page 388
Return to index page 387
Return to index page 386
Return to index page 385
Return to index page 384
Return to index page 383
Return to index page 382
Return to index page 381
Return to index page 380