私の C# コードでは、次のような接続文字列を使用します。
connection = new SqlConnection(ConfigurationManager.AppSettings["myconnectionstring"])
これは正常に動作します。
私は今<asp:SqlDataSource
コントロールを使用しようとしていますが、次のようにコントロールで上記の接続文字列を使用できないようです:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConfigurationManager.AppSettings["myconnectionstring"] %>"
SelectCommand="SELECT * from table1"></asp:SqlDataSource>
次のようなエラーが表示されます。
パーサー エラー メッセージ: サーバー タグの形式が正しくありません。
私は何を間違っていますか?