VoteList2.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Party.Ui; using SubSonic; using System.Data; public partial class V2VOTE_VoteList2 : System
DataTable dt = new DataTable(); dt.Columns.Add("clmn1", System.Type.GetType("System.String")); dt.Columns.Add("clmn2", System.Type.GetType("System.String")); for (int i = 0; i < 3; i++) { DataRow dr = dt.NewRow()
1. 将DataTable 绑定到BindingSource 2. 将BindingSource绑定到DataGridView 3. DataGridView修改完要从Datatable取值时,同步过去时,BindingSource和DataGridView两个都要执行EndEdit() 例程: public partial class Form1 : Form { DataTable mTable = new DataTable(); BindingSource mbs = new Bindi