datagrid还是什么? [英] datagrid or what?
问题描述
我可以将存储在xml中的数据放在哪里?可以在桌子上吗?在datagrid视图上?
我没有在做基于Web的应用程序.
请为此建议一个更好的代码.
[从答案中移出]
我可以将xml文件加载到datagridview吗?如果是这样,怎么办?请帮助我..
where can i place the data stored in xml? can it be on table? on datagrid view?
i''m not doing web base application.
please suggest a better code for this.
[Moved from Answer]
Can i load xml file into datagridview? if so, how? please help me..
推荐答案
试试这个....(我认为这将根据您的问题为您提供帮助)
步骤1:
像这样将xml文件读入DataSet
Hi,
Try This .... (i think it will help you as per your question)
Step1:
Read the xml file into DataSet like this
DataSet ds = new DataSet();
ds.ReadXML("XML File Path");
**注意:将Xml文件保存在FileSystem上.
步骤2:
像这样将DataSet表分配到您的DataGridView中
**Note: Save Xml Files on FileSystem.
Step2:
Assign DataSet Tables into your DataGridView like this
DataGridView1.DataSource = ds.Tables[0];
也看看这个.
http://msdn.microsoft.com/en-us/library/ekw4dh3f(VS .71).asp [ ^ ]
Have a look on this also.
http://msdn.microsoft.com/en-us/library/ekw4dh3f(VS.71).asp[^]
yummy02,
您可以将XML文件中的数据放在Grid或Table中.
无论哪种方式,它都可以工作.
Hi yummy02,
you can place the data from XML file either in Grid or in Table.
Either way, it will work.
这篇关于datagrid还是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!