I have a database at location xmachina\sqlexpress named News, News has a table NewsTable. How do I tell ASP to look at News database? Is it part of the SelectCommand? Or a webconfig variable?
Right now I get a [SqlException (0x80131904): Invalid object name 'NewsTable'.]
web.config
<add name="NewsTableConnectionString" connectionString="Data Source=XMACHINA\SQLEXPRESS;Integrated Security=True" providerName="System.Data.SqlClient" />
Default.aspx
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:NewsTableConnectionString %>"
ProviderName="<%$ ConnectionStrings:NewsTableConnectionString.ProviderName %>"
SelectCommand="SELECT [NewsHeadline] FROM [NewsTable]">
</asp:SqlDataSource>