简体   繁体   English

需要我的C#Winforms GUI应用程序加载和搜索巨大的xml(〜1GB)

[英]Need my c# winforms gui application to load and search huge xml(~1GB)

i need to create ac# GUI windows software to load,search and filter huge xml file(~1GB). 我需要创建ac#GUI Windows软件来加载,搜索和过滤巨大的xml文件(〜1GB)。 Its not for a specific xml, so i need a generic solution. 它不是针对特定的xml,因此我需要通用的解决方案。 I need help in approaching the problem. 在解决问题上,我需要帮助。 Like what libraries,frameworks and UI Controls can i use to load huge xml file and how can i represent it in GUI to efficiently search and filter through the xml files. 像库,框架和UI控件一样,我可以用来加载巨大的xml文件,以及如何在GUI中表示它以有效地搜索和过滤xml文件。 I have tried using 我尝试使用

  • Dataset to load xml file and display it in datagridview. 加载XML文件并在datagridview中显示的数据集。 but since my xml is too nested, it creates multiple tables and thus makes it impossible to represent in a single view. 但是由于我的xml过于嵌套,因此它创建了多个表,因此无法在单个视图中表示。

  • Excel interop library to import xml into worksheet and then to Datatable and display in datagridview. Excel interop库将xml导入工作表,然后导入到Datatable并显示在datagridview中。 It works fine for small files. 它适用于小文件。 but files above 5MB it keeps on loading and becomes unresponsive. 但是5MB以上的文件会继续加载,并且无法响应。

  • I thought of loading it into sqllite database and then load it in datagridview. 我想到将其加载到sqllite数据库中,然后再将其加载到datagridview中。 but sqllite does not seems to provide a way to import xml files directly. 但是sqllite似乎没有提供直接导入xml文件的方法。

Help me in solving the problem. 帮助我解决问题。 Thank you. 谢谢。

Well I don't think loading 1GB of document in the memory is a good approach. 好吧,我认为在内存中加载1GB文档不是一个好方法。 I am not even sure that you can take all the memory you want, because you have some limitations on memory usage . 我什至不确定您是否可以使用所有想要的内存, 因为您对内存使用量有一些限制

Personally I would load the document not all at once but in pieces, and with pagination in order to limit memory usage and guarantee a good performance. 我个人不是一次全部加载文档,而是分页加载文档,以限制内存使用并保证良好的性能。

That being said, if you take this approach you can use the methos you mentioned. 话虽如此,如果您采用这种方法,则可以使用您提到的方法。


Useful Links 有用的链接

Reading parts of large files from drive 从驱动器读取大文件的一部分

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM