public DataTable MakeDataTable(){

    DataTable myTable;
DataRow myNewRow;
// Create a new DataTable.
myTable = new DataTable("My Table"); // Create DataColumn objects of data types.
DataColumn colString = new DataColumn("StringCol");
colString.DataType = System.Type.GetType("System.String");
myTable.Columns.Add(colString); DataColumn colInt32 = new DataColumn("Int32Col");
colInt32.DataType = System.Type.GetType("System.Int32");
myTable.Columns.Add(colInt32); DataColumn colBoolean = new DataColumn("BooleanCol");
colBoolean.DataType = System.Type.GetType("System.Boolean");
myTable.Columns.Add(colBoolean); DataColumn colTimeSpan = new DataColumn("TimeSpanCol");
colTimeSpan.DataType = System.Type.GetType("System.TimeSpan");
myTable.Columns.Add(colTimeSpan); DataColumn colDateTime = new DataColumn("DateTimeCol");
colDateTime.DataType = System.Type.GetType("System.DateTime");
myTable.Columns.Add(colDateTime); DataColumn colDecimal = new DataColumn("DecimalCol");
colDecimal.DataType = System.Type.GetType("System.Decimal");
myTable.Columns.Add(colDecimal); DataColumn colByteArray = new DataColumn("ByteArrayCol");
colByteArray.DataType = System.Type.GetType("System.Byte[]");
myTable.Columns.Add(colByteArray); // Populate one row with values.
myNewRow = myTable.NewRow(); myNewRow["StringCol"] = "Item Name";
myNewRow["Int32Col"] = ;
myNewRow["BooleanCol"] = true;
myNewRow["TimeSpanCol"] = new TimeSpan(,,,,);
myNewRow["DateTimeCol"] = System.DateTime.Today;
myNewRow["DecimalCol"] = 64.0021;
myNewRow["ByteArrayCol"] = new Byte[] { , , };
myTable.Rows.Add(myNewRow);
return myTable;
}

最新文章

  1. python基础04 运算
  2. You Don't Need jQuery
  3. hdu 4759 大数+找规律 ***
  4. 【CodeVS】 p1225 八数码难题
  5. Yii 框架表单验证---实例
  6. linux OpenOffice
  7. QT 让窗口(或控件)居中
  8. poj2478--欧拉函数打表
  9. 给Linux添加google搜索命令
  10. 浅谈对象的两个方法:Object.keys() ,Object.assign();
  11. 怎么在父窗口调用它页面的iframe里面数据,进行操作?
  12. Putty Technical Note
  13. P1569 [USACO11FEB]属牛的抗议
  14. DALFactory有什么作用
  15. 最简单,有效的学习mysql教程(一)
  16. "Hello World!"团队第十次会议
  17. bzoj 1110 贪心 + 进制转换
  18. 18 Command Line Tools to Monitor Linux Performance
  19. HDU 2648(搜索题,哈希表)
  20. Selenium之当鼠标悬浮时隐藏的元素才出现

热门文章

  1. 前端学习——css(初级)
  2. websocket小荔枝
  3. CentOS7.5安装配置conky(极简)
  4. html和url两种录制方式
  5. Codeforces 1082 D. Maximum Diameter Graph-树的直径-最长链-构造题 (Educational Codeforces Round 55 (Rated for Div. 2))
  6. 洛谷 P3384 【模板】树链剖分-树链剖分(点权)(路径节点更新、路径求和、子树节点更新、子树求和)模板-备注结合一下以前写的题目,懒得写很详细的注释
  7. MediaPlayer滑动不准的问题
  8. 一个菜鸟正在用SSH写一个论坛(1)
  9. leetcode88 Merged Sorted Array
  10. CodeForces - 524F And Yet Another Bracket Sequence