如何使用ConfigurationSettings获取连接字符串
rt.
错误:ConnectionString尚未初始化
string s = ConfigurationManager.AppSettings["connstr"];
SqlConnection conn = new SqlConnection(s);
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from stu", conn);
DataTable dt = new DataTable();
da.Fill(dt);
this.DataGrid1.DataSource = dt;
this.DataGrid1.DataBind();
conn.Close();
请指教!