//没啥。。彭彭自己用的。。超简单。。如果想查看更详细的资料的话,就上google搜 [.net 创建 datatable]好了。。
   common.db db = new common.db();
   DataTable dt = db.returnTable("select * from pathtb");
   dt.Rows[0]["ptName"] = "ppp";

   DataColumn newColumn;
   newColumn = dt.Columns.Add("rtp",Type.GetType("System.String"));
   newColumn.AllowDBNull=true;//AllowDBNull 是否可以为空 true false
   newColumn.MaxLength=50;
   newColumn.DefaultValue = "rtp";

   dt.Rows[0]["ptName"] = "ppp";
   dt.Rows[0]["rtp"] = "jkjjrtp";

 

   for(int i = 0;i<dt.Rows.Count;i++)
    this.Page.Response.Write(dt.Rows[i]["ptName"].ToString()+dt.Rows[i]["rtp"].ToString()+"<br>");
   db.close();
// Vs2003下调试成功!

相关文章:

  • 2021-08-19
  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2021-10-11
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-11
  • 2021-07-27
  • 2022-02-15
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案