C#怎么调用后台的方法来执行select语句
1个回答
展开全部
SqlConnection conn = new SqlConnection(strSqlConn);
conn.Open();
SqlCommand comm = new SqlCommand("Select * from tablename");
SqlDataAdapter adpt = new SqlDataAdapter(comm);
DataTable dt = new DataTable();//select取回的值
adpt.Fill(dt);
conn.Close();
conn.Open();
SqlCommand comm = new SqlCommand("Select * from tablename");
SqlDataAdapter adpt = new SqlDataAdapter(comm);
DataTable dt = new DataTable();//select取回的值
adpt.Fill(dt);
conn.Close();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询