日期:2014-05-18  浏览次数:20417 次

怎样给table加名字
DataSet ds = new DataSet();
 DataTable dt = new DataTable("book");
 dt = book.GetDate().Copy();
 ds.Tables.Add(dt);
这样复制进ds的table名字就是"table"。。我想把table名字改成我想要的。比如说该成book。。怎样能做到。。
各位大哥大姐教教小弟吧。。谢谢了
 
 

------解决方案--------------------
ds.Tables[0].TableName = "book";
------解决方案--------------------
DataSet ds = new DataSet(); 
DataTable dt = new DataTable("book"); 
dt = book.GetDate().Copy(); 
ds.Tables.Add(dt); 
ds.Tables[0].TableName = "book";
------解决方案--------------------
DataSet ds = new DataSet(); 
 DataTable dt = new DataTable("book"); 
 dt = book.GetDate().Copy(); 
 dt.TableName = "book";
 ds.Tables.Add(dt);