#2
foxxo51x2014-01-16 17:13
|
wpf datagrid 跟数据库绑定 只显示一行,也就是数据库里的第一行内容
代码
dataGrid1.CanUserAddRows = true;
dt = new DataSet();
OleDbDataAdapter objAdapter8 = new OleDbDataAdapter("select * from UserName", ConnectionAccess);
objAdapter8.Fill(dt, "UserName");
this.dataGrid1.ItemsSource = dt.Tables;
ConnectionAccess.Close();