我收到此 c# 代码的错误
if (radioAll.Checked)
{
SqlDataSource DataSource2 = new SqlDataSource();
DataSource2.ID = "SqlDataSource2";
this.Page.Controls.Add(DataSource2);
DataSource2.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["SEP_Project_NewConnectionString2"].ConnectionString;
DataSource2.SelectCommand = "SELECT courseNo,title from Course";
gridview_modules.DataSource = DataSource2;
gridview_modules.DataBind();
}
错误如下
连接字符串没问题。如何修复此错误?