I have a gridview defined in my aspx page having a DataSourceID="myDataSourceID". I have a <asp:SqlDataSource ID="myDataSourceID ...</asp:SqlDataSource> on the same page. The first time a user comes onto the page that is the datasource I want to use to load the gridview...I works no problems.
I also have some check boxes on the page in a CheckBoxList with OnSelectedIndexChanged="myCodeBehind". In myCodeBehind I build a query using the values of the checkboxes (thanks akhhttar) and try to use the query in to bind data to the gridview...
Dim SqlDataSource1 As New SqlDataSource
SqlDataSource1.ConnectionString = "$ ConnectionStrings:startpagegridview1ConnectionString"
SqlDataSource1.ProviderName = "$ ConnectionStrings:startpagegridview1ConnectionString.ProviderName"
SqlDataSource1.SelectCommand = Query
GridView1.DataSource = SqlDataSource1
Site builds and publishes ok, but at runtime...
Server Error in '/' Application.
Both DataSource and DataSourceI
View Complete Post