我可以将数据网格架构和数据存储到DataTable吗?
问题描述:
DataTable dt =(DataTable)(GridView1.DataSource);
我使用了上面的代码。有错误,但我无法获得GridView1中的Schema和数据。只获取表的名称。你能帮帮我吗?
DataTable dt=(DataTable)(GridView1.DataSource);
I used a code as above . There is error but I can't getting the Schema and the data like in the GridView1. Only getting the Name of the Table. Could you help me?
答
试试这个会帮到你
DataTable dt1 = GridView1.DataSource as DataTable;
try this it will help you
DataTable dt1 = GridView1.DataSource as DataTable;