1
訪問數據庫,我使用的MS Access數據庫的2013名是 「通訊」,密碼爲 「某某@ 12345」連接使用C#Web.config文件
Web.config中的連接字符串:
<add name="commconn" connectionString="Provider=Microsoft.ACE.OLEDB.12.0; Data Source=E:/ee/comm.accdb; Jet OLEDB:Database [email protected];" />
當我運行我的網站時,它只給出一個錯誤,我的DropDownList綁定數據和錯誤是 「不是有效的密碼。」
我使用此代碼綁定我的DropDownList:
<asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="AccessDataSource1" DataTextField="share_amt" DataValueField="ID">
</asp:DropDownList>
<asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/comm.accdb" SelectCommand="SELECT * FROM [share_amt] ORDER BY [ID]">
</asp:AccessDataSource>
我使用的MS Access 2013數據庫和ASP.Net與C#。