[c#]代码库
//查询返回直接是数据
protected void Button3_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds = Common.NoPager2("test", "", "News", "", "id=" + TextBox3.Text + "");
GridView2.DataSource = ds;
GridView2.DataBind();
}
//先填充到SqlDataAdapter
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection sqlconn = c1.sqlcon();
sqlconn.Open();
DataSet ds = new DataSet();
SqlDataAdapter sda = new SqlDataAdapter("select * from test", sqlconn);
sda.Fill(ds);
GridView1.DataSource = ds;
GridView1.DataBind();
sqlconn.Close();
}
by: 发表于:2018-01-29 10:59:29 顶(0) | 踩(0) 回复
??
回复评论