刚学有点疑问,请看注释
etilm 2011-01-07 02:07:58 protected void Page_Load(object sender, EventArgs e)
{
string mycon;
string mmstr="select * from info";
mycon = ConfigurationManager.AppSettings["connstring"];
SqlConnection con = new SqlConnection(mycon);
con.Open();
SqlDataAdapter sdr=new SqlDataAdapter(mmstr,con);
DataSet ds = new DataSet();
sdr.Fill("ds", info);//上下文不存在info,这里说要表名?不是我上面select语句里面的表名吗??
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
con.Close();
}