惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
U
Unit 42
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
G
Google Developers Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
罗磊的独立博客
博客园 - Franky
J
Java Code Geeks
S
SegmentFault 最新的问题
D
DataBreaches.Net
C
Check Point Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
有赞技术团队
有赞技术团队
腾讯CDC
博客园_首页
美团技术团队
V
Visual Studio Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
The Cloudflare Blog
aimingoo的专栏
aimingoo的专栏

博客园 - 彭灿明

使用int?来确保值类型也可以为null SQL总结 .NET1.0升级至2.0十个问题 这两者需要映射到相同的服务器,从而无法打开项目的解决方法: 使用Server.Transfer,Response.Redirect注意点 Server.Transfer,Response.Redirect的区别 - 彭灿明 - 博客园 数据处理 分页语句 刘佳传的 xml节点删除修改 C# 3.0 新特性初步研究 在Asp.net中为图像加入版权信息 javascript 动态添加表格行 HTML结构化:实践DIV+CSS网页布局入门指南 BLOG技巧:用Javascript为你的Blog做一个计数器 .Net中常见问题及解决方法归类 Visual Studio 2005常用插件搜罗 微软开源官方网站上线! RSS在线阅读器 数据库设计成功!
构造DATATABLE
彭灿明 · 2006-07-05 · via 博客园 - 彭灿明

private void MakeTable(DataTable myTable){
   // Create a DataTable. DataTable myTable = new DataTable("myTable");
   // Create a DataColumn and set various properties.
   DataColumn myColumn = new DataColumn();
   myColumn.DataType = System.Type.GetType("System.Decimal");
   myColumn.AllowDBNull = false;
   myColumn.Caption = "Price";
   myColumn.ColumnName = "Price";
   myColumn.DefaultValue = 25;
   // Add the column to the table.
   myTable.Columns.Add(myColumn);
   // Add 10 rows and set values.
   DataRow myRow;
   for(int i = 0; i < 10; i++){
      myRow = myTable.NewRow(); myRow["Price"] = i + 1;
      // Be sure to add the new row to the DataRowCollection.
      myTable.Rows.Add(myRow);
   }
}
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.2052/cpref/html/frlrfSystemDataDataTableClassTopic.htm