myDataColumn.ReadOnly = true;
myDataColumn.Unique = true;
myDataTable.Columns.Add(myDataColumn);
myDataColumn = new DataColumn();
myDataColumn.DataType = System.Type.GetType("System.String");
myDataColumn.ColumnName = "商品名称";
myDataTable.Columns.Add(myDataColumn);
myDataColumn = new DataColumn();
myDataColumn.DataType =System.Type.GetType("System.Decimal");
myDataColumn.ColumnName = "商品价格";
myDataTable.Columns.Add(myDataColumn);
//为数据表添加数据行
myDataRow = myDataTable.NewRow();
myDataRow["id"] = 1;
myDataRow["商品名称"] = "足球";
myDataRow["商品价格"] =57.5;
myDataTable.Rows.Add(myDataRow);
myDataRow = myDataTable.NewRow();
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页 |