创建空白行DataTable
2017-01-25 17:41:17 访问(1610) 赞(0) 踩(0)
/// <summary>
/// 创建空白行DataTable
/// </summary>
/// <returns></returns>
public DataTable DataTable4Empty(int max)
{
DataTable theResult = new DataTable();
theResult.Columns.Add(new DataColumn("ID"));
DataRow dr =null;
for (int i = 1; i <= max; ++i)
{
dr = theResult.NewRow();
dr["ID"] = i;
theResult.Rows.Add(dr);
}
return theResult;
}
标签:
创建空白行DataTable 


上一条:
下一条:
相关评论
发表评论