C#:DataSet和DataTable区别和用法

try

{

SqlDataAdapter da = new SqlDataAdapter("select * from WAIT_BED_PATS", sqlconnection);

DataSet ds = new DataSet();

da.Fill(ds, "WAIT_BED_PATS");

DataTable DT = ds.Tables["WAIT_BED_PATS"];

dataGridView1.DataSource = DT;

}

catch (SqlException EX)

{

MessageBox.Show(EX.Message);

}

posted @ 2017-08-12 10:16  jiangcm  阅读(189)  评论(0编辑  收藏  举报