Forum Moderators: open
My question is-- is there any way to access the configure data source dialog from the source code view? Every resource I've found on the MSDN site says to "switch to design view" then configure the data source.
Thanks
You haven't mentioned which DataSource you are using so I have made a quick example with a SQLDataSource:
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
SelectCommand="SELECT [Name], [County] FROM [CityInfo] WHERE ([Name] = @Name)">
<SelectParameters>
<asp:QueryStringParameter DefaultValue="belfast" Name="Name"
QueryStringField="city" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
You can also manipulate the DataSource properties from code-behind.