Пример #1
0
        private void ProjectManage_Load(object sender, EventArgs e)
        {
            DataSet Ds = _projectInfos.GetAllProjectInfos();

            //使用DataSet绑定时,必须同时指明DateMember
            this.dataGridView1.DataSource = Ds;
            this.dataGridView1.DataMember = "ProjectInfo";

            //也可以直接用DataTable来绑定
            //this.dataGridView1.DataSource = Ds.Tables["ProjectInfo"];
        }