、それはこのようなデータソースを生成します。のVisual Studio、Visual StudioでAsp.netの接続文字列
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString1 %>"
SelectCommand="SELECT top 10 * FROM [Address]">
</asp:SqlDataSource>
それを実行すると、それは無効なオブジェクト」を言うだろう。その後、私はそれは、接続文字列は、次に、どのようにこの形式を使用するためにVSに設定へ
<connectionStrings>
<add name="AdventureWorksConnectionString1" connectionString="Data Source=localhost\SQLEXPRESS;Initial Catalog=AdventureWorks;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>
ある
[AdventureWorks].[Person].[Address]
する必要があり、それを見つけましたか?
接続文字列はどのようなものが見えますか? Odedが既に指摘している点を除いて、「Initial Catalog = AdventureWorks」が見つからず、あなたのクエリは* master *データベースに向けられています。 – Filburt