我可以将数据网格架构和数据存储到DataTable吗? [英] Can I store a datagrid Schema and Data to a DataTable?

查看:66
本文介绍了我可以将数据网格架构和数据存储到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;


这篇关于我可以将数据网格架构和数据存储到DataTable吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆