Specific design ideas
(1). Obtain the name of the Excel file to be accessed
(2) read the content of an Excel file
(3). Display in datagrid format
Source code:
<% @ Page Language = "VB" %>
<% @ Import namespace = "system. Data" %>
<% @ Import namespace = "system. Data. oledb" %>
<Script language = "VB" runat = "server">
Sub page_load (sender as object, e as eventargs)
Dim mydataset as new dataset ()
Dim myoledbconnection as oledbconnection = new oledbconnection ("provider = Microsoft. Jet. oledb.4.0 ;"&_
"Data Source = c: \ full set of tables to keep track of tables .xls ;"&_
"Extended properties =" "Excel 8.0 ;""")
Dim myoledbcommand as oledbcommand = new oledbcommand ("select * from [meld $]", myoledbconnection)
Dim mydata as oledbdataadapter = new oledbdataadapter (myoledbcommand)
Mydata. Fill (mydataset)
Datagrid1.datasource = mydataset. Tables (0). defaultview
Datagrid1.databind ()
End sub
</SCRIPT>
<HTML>
<Head>
<Body>
<Asp: Label id = "L1" runat = "server"> </ASP: Label>
<Asp: DataGrid id = maid = "server"/>
</Body>
</Html>
However, this method can display the data in the Excel document, but it cannot display the image!
This document is as follows:
When displayed in a browser, the picture in the "Shoes" column will be blank! [No Data]
How can I modify the above section?ProgramIn the browser."Complete"What about the displayed Excel file?
Or, is there no better way to achieve it?
Dudu, I'm in a hurry. Please use it on the homepage for now!
Remove it immediately after discussion. Thank you!