大虾: 偶是菜鸟,求助一个问题如下: '动态建立数据集体.动态添加表和2列.怎样才能加入多行。可能数据集要变成公用的.加完一行再刷新以前加的行和这次加的才都能显示出来.但我不知道怎么能都显示出来.我做的只能显示这次加的.以前的不见了。 Dim myDataSet As DataSet Dim myDataTable As DataTable = New DataTable("attendtimetable") Dim myDataColumn As DataColumn Dim myDataRow As DataRow '第一列 myDataColumn = New DataColumn myDataColumn.DataType = System.Type.GetType("System.String") myDataColumn.ColumnName = "date" myDataTable.Columns.Add(myDataColumn) '第二列 myDataColumn = New DataColumn myDataColumn.DataType = System.Type.GetType("System.String") myDataColumn.ColumnName = "time" myDataTable.Columns.Add(myDataColumn)
myDataSet = New DataSet myDataSet.Tables.Add(myDataTable) myDataRow = myDataTable.NewRow()
myDataRow("date") = TextBox7.Text myDataRow("time") = DateTime.Now myDataTable.Rows.Add(myDataRow) myDataSet.AcceptChanges() DataGrid3.DataSource = myDataSet.Tables("attendtimetable") 该如何解决,谢谢了