I want to use a SQL server on my hosted WEB site. using Microsoft SQL Server Management Studio R8 ver. 10.50.1617.0. I can connect and query data etc.
In Visual WEB Developer Express 2010 I can click on the combo configure the data source and drill down thru to see valid records and test it. it returns results just fine.
Viewing the WEB site either on my local machine or the hosted WEB site the combo box is empty.
No errors, no nothing. a page with an empty combo box. Can anyone see anything wrong or missing. I created the connection string by scratch in the WEB config file.
WEB config file
aspx page
DougP
In Visual WEB Developer Express 2010 I can click on the combo configure the data source and drill down thru to see valid records and test it. it returns results just fine.
Viewing the WEB site either on my local machine or the hosted WEB site the combo box is empty.
No errors, no nothing. a page with an empty combo box. Can anyone see anything wrong or missing. I created the connection string by scratch in the WEB config file.
WEB config file
Code:
<connectionStrings>
<add name="DatabaseExternalConnectionString" connectionString="Data Source=mywebsite.com; Initial Catalog=mydb; User Id=myuser; Password=Pass;" providerName="System.Data.SqlClient"/>
aspx page
Code:
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
Choose Part #
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"
DataSourceID="SqlDataSource1" DataTextField="PartNum"
DataValueField="PartNum">
<asp:ListItem Selected="True">Choose part</asp:ListItem>
</asp:DropDownList>
</div>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:DatabaseExternalConnectionString %>"
ProviderName="<%$ ConnectionStrings:DatabaseExternalConnectionString.ProviderName %>"
SelectCommand="SELECT [PartNum], [ID], [Description], [Qty], [VendorID] FROM [Inventory] WHERE ([PartNum] = @PartNum)">
<SelectParameters>
<asp:ControlParameter ControlID="DropDownList1" Name="PartNum"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
DougP