using System.Data; //引用命名空间
using System.Data.SqlClient;
SqlConnection con = new SqlConnection("server=(local);database=sq_ncxhdata;uid=sa;Pwd=zhongshuangqian");
SqlDataAdapter msda = new SqlDataAdapter("select * from UserInfo", con);
DataSet ds = new DataSet();
msda.Fill(ds);
con.Close();
this.GridView1.DataSource = ds;
this.GridView1.DataBind();