DataTable dt = new DataTable();
dt.Columns.Add(new DataColumn("URL", typeof(string)) );
dt.Columns.Add(new DataColumn("DocName", typeof(string)) );

DataRow dr = dt.NewRow();
dr["URL"] = "http://www.google.com";
dr["DocName"] = "google";
dt.Rows.Add(dr);
dr = dt.NewRow();
dr["URL"] = "http://www.yahoo.com";
dr["DocName"] = "yahoo";
dt.Rows.Add(dr);

Files.DataSource = dt.DefaultView;
Files.DataBind();

 

上述代码演示了如何在DataTable中增加DataRow。

相关文章:

  • 2021-11-12
  • 2022-01-29
  • 2022-12-23
  • 2021-10-10
  • 2021-07-22
  • 2021-08-07
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-02-10
相关资源
相似解决方案