日期:2014-05-18 浏览次数:20815 次
private void SetUp() { // 用2个Table和1和Relation创建 DataSet MakeDataSet(); // 数据绑定 dataGrid1.SetDataBinding(myDataSet, "Customers"); //添加样式 AddCustomDataTableStyle(); }
------解决方案--------------------
DataSet myDataSet1 = new DataSet();
string sql1="select id as 序号,address as 网址,name as 名称,bz as 说明 from usermanage";
DataTable dt=DB.DataAccess.GetAccessData(sql1);
//dt.TableName = "dt";
myDataSet1.Tables.Add(dt);
dataGrid1.SetDataBinding(myDataSet1, "dt");
AddCustomDataTableStyle();