展开全部
SqlConnection conn
= new SqlConnection("server=.;database=database;uid=sa;pwd=123456");//你自己的数据库链接
SqlCommand cmd = new SqlCommand("select * from text", conn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();sda.Fill(ds);
//进行相关绑定 例如 gridview
gridview.DataSource = ds;
gridview.Databind();
= new SqlConnection("server=.;database=database;uid=sa;pwd=123456");//你自己的数据库链接
SqlCommand cmd = new SqlCommand("select * from text", conn);
SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();sda.Fill(ds);
//进行相关绑定 例如 gridview
gridview.DataSource = ds;
gridview.Databind();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询