C#怎么调用后台的方法来执行select语句

2024-11-16 22:32:14
推荐回答(1个)
回答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();