All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
ASP.NET技巧:远程抓取GOOGLE的自动翻译结果_[Asp.Net教程]
[delphi语法3]声明delphi几个常用语句方法
.net(C#)开发小技巧漫谈之一_[Asp.Net教程]
PHP动态网页程序中常用的表单验证类_php资料_编程技术
高度100%的绝对定位自适应布局技巧_[Html教程]
无废话C#设计模式之六:Builder_.net资料_编程技术
C#教程:C#中的隐式类型转换
XSL教程:学会如何使用XPath入门_[XML教程]
asp.net2.0控件DataList实例应用
ASP.NET中“找不到指定模块”的解决办法_.net资料_编程技术
Reading number is top 10 pictures
宝贝系列
白嫩丰满美女照片
The woman fight much more than men
Japan sexy beauty passion photo
Most cow mistress ZhaoGongXia face exposure
Household design of gorgeous series
日本小萝莉2
The real super beauty8
Entered the goddess in the AD1
Exquisite decoration is not paying too much2
Download software ranking
传奇私服架设教程
Unix video tutorial8
Boxer's Top ten classic battle4
Unix video tutorial6
Unix video tutorial15
C#与.NET技术平台实战演练
WebService在.NET中的实战应用教学视频 → 第3集
Boxer's Top ten classic battle5
Tram sex maniac 2 (H) rar bag6
matrix3
归海一刀 published in(发表于) 2014/1/30 1:31:43 Edit(编辑)
动态生成DataTable代码_[Asp.Net教程]

动态生成DataTable代码_[Asp.Net教程]

动态生成DataTable代码_[Asp.Net教程]
private DataTable CreateTable()
{
DataTable dt = new DataTable("dirName");
#region table column
DataColumn columnID = new DataColumn(); //创建一列
columnID.DataType = System.Type.GetType("System.Int32"); //数据类型
columnID.ColumnName = "ID"; //列名
columnID.AutoIncrement = true; //自动递增ID号
dt.Columns.Add(columnID); //添加到table
DataColumn columnName = new DataColumn();
columnName.DataType = System.Type.GetType("System.String");
columnName.ColumnName = "Name";
dt.Columns.Add(columnName);
DataColumn fullName = new DataColumn();
fullName.DataType = System.Type.GetType("System.String");
fullName.ColumnName = "fullName";
dt.Columns.Add(fullName);
DataColumn cTime = new DataColumn();
cTime.DataType = System.Type.GetType("System.String");
cTime.ColumnName = "CreateDate";
dt.Columns.Add(cTime);
DataColumn type = new DataColumn();
type.DataType = System.Type.GetType("System.String");
type.ColumnName = "type";
dt.Columns.Add(type);
DataColumn exName = new DataColumn();
exName.DataType = System.Type.GetType("System.String");
exName.ColumnName = "exName";
dt.Columns.Add(exName);
DataColumn size = new DataColumn();
size.DataType = System.Type.GetType("System.Int32");
size.ColumnName = "size";
dt.Columns.Add(size);
#endregion
//设置主键
DataColumn[] keys = new DataColumn[1];
keys[0] = columnID;
dt.PrimaryKey = keys;
for (int i = 0; i < 3; i++)
{
DataRow row;
row = dt.NewRow();
row["Name"] = "陈yu**";
row["fullName"] = "陈**";
row["exName"] = "";
row["CreateDate"] = System.DateTime.Now.ToShortDateString();
row["type"] = "1";
row["size"] = 0;
dt.Rows.Add(row);
}
return dt;
}


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.