DataSet做Entity的问题
我用DataSet做实体,如果要在DataGirdview上添加数据,用DataSet怎么样获取呢--------------------编程问答-------------------- DataBind() --------------------编程问答-------------------- DataSet ds = new DataSet();
DataTable dt = new DataTable("yeji");
dt.Columns.Add("部门", typeof(System.String));
dt.Columns.Add("店名", typeof(System.String));
dt.Columns.Add("店长名", typeof(System.String));
dt.Columns.Add("总业绩", typeof(System.Int32));
dt.Columns.Add("租合同数", typeof(System.Int32));
dt.Columns.Add("售合同数", typeof(System.Int32));
DataColumn[] dckey = new DataColumn[] { dt.Columns["部门"] };
dt.PrimaryKey = dckey;
DataRow dr = dt.NewRow();
dr[0] = "餐饮部";
dr[1] = "店1";
dr[2] = "店长";
dr[3] = 1000;
dr[4] = 2000;
dr[5] = 3000;
dt.Rows.Add(dr);
ds.Tables.Add(dt);
this.GridView1.DataSource = ds;
this.GridView1.DataBind();
补充:.NET技术 , C#