asp.net 怎么绑定GridView1
asp.net怎么绑定GridView1SqlConnectionmyconn;SqlDataAdaptermyadapter;DataSetmyds;stringsql...
asp.net
怎么绑定GridView1
SqlConnection myconn;
SqlDataAdapter myadapter;
DataSet myds;
string sqltext = "select * from t_sys_news";
string sqlconn = "Data Source=ZC;Initial Catalog=asp;User ID=sa;Password=123";
myconn = new SqlConnection(sqlconn);
myconn.Open();
myadapter = new SqlDataAdapter(sqltext, myconn);
myds = new DataSet();
myadapter.Fill(myds, "t_sys_news");
GridView1.DataSource = myds.Tables[0];
GridView1.DataBind();
myconn.Close();
没反应啊 展开
怎么绑定GridView1
SqlConnection myconn;
SqlDataAdapter myadapter;
DataSet myds;
string sqltext = "select * from t_sys_news";
string sqlconn = "Data Source=ZC;Initial Catalog=asp;User ID=sa;Password=123";
myconn = new SqlConnection(sqlconn);
myconn.Open();
myadapter = new SqlDataAdapter(sqltext, myconn);
myds = new DataSet();
myadapter.Fill(myds, "t_sys_news");
GridView1.DataSource = myds.Tables[0];
GridView1.DataBind();
myconn.Close();
没反应啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询