sqldatasource连接excel 2003
sqldatasource连接excel 2003 gridview显示数据
连接字符串:
<connectionstring>
<add name="db" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\book1.xls;Extended Properties='Excel 8.0;HDR=Yes;IMEX=1'"
providerName="System.Data.OleDb" />
</connectionstring>
源代码
<asp:SqlDataSource ID="db" ConnectionString="<%$ ConnectionStrings:ConnectionString2 %>"
ProviderName="<%$ ConnectionStrings:ConnectionString2.ProviderName %>" SelectCommand="SELECT * FROM [sheet1$]" runat="server"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="db" Width="469px">
</asp:GridView>