简体   繁体   English

普通C#窗口表单应用程序可以在datagridview中轻松加载多少行

[英]How many rows a normal C# window form application can load easily in datagridview

I am using datagridview for data rendering in window form application. 我正在使用datagridview在窗口表单应用程序中进行数据呈现。 application is actually fetching a lot of rows and the system gets stuck and goes to not responding state. 应用程序实际上获取了很多行,并且系统陷入了停滞,并进入了无响应状态。 it is normally getting 100K + rows. 通常会获得100K +行。 How many rows a normal C# window form application can load easily in datagridview 普通C#窗口表单应用程序可以在datagridview中轻松加载多少行

I'm not aware of any hard limitations. 我不知道有任何硬性限制。 This would be based on factors like the amount of resources available to the application. 这将基于诸如可用于应用程序的资源量之类的因素。 If you're rendering high amounts of data, you may want to consider using virutal mode. 如果要渲染大量数据,则可能要考虑使用虚拟模式。 https://docs.microsoft.com/en-us/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control https://docs.microsoft.com/zh-cn/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control

I don't think its good idea to first of fetch 100k+ rows and show all on grid, use can use paging that will be quicker and more efficient. 我认为先获取100k +行并在网格上显示所有内容不是一个好主意,使用可以使用分页会更快,更高效。 You can control how many records you want to fetch at once based on traffic and performance of your database. 您可以根据数据库的流量和性能来控制一次要获取多少条记录。

@pageNumber AS INT,
@rowsPerPage AS INT,

OFFSET((@PageNumber -1) * @RowsPerPage) ROWS
FETCH NEXT @RowsPerPage ROWS ONLY;
GO

Read this article : https://10tec.com/articles/why-datagridview-slow.aspx 阅读本文: https : //10tec.com/articles/why-datagridview-slow.aspx

I have analysed the application and found out that there is nothing wrong with the datagridview. 我分析了该应用程序,发现datagridview没有任何问题。 it can contain 100K rows if required. 如果需要,它可以包含10万行。 there are some other functions that executes once the data loads which takes lot of time and puts the application in not responding state. 加载数据后,还有其他一些函数会执行,这会花费大量时间,并使应用程序处于无响应状态。 Virtual mode and Paging are also good options. 虚拟模式和分页也是不错的选择。 And I agree with your points that 100K rows are too much for a human to process. 我同意您的观点,即10万行对于人类来说实在太多了。 thats just the wastage of resources and effort. 那就是浪费资源和精力。 I understand that. 我明白那个。 I am actually trying to improve someone else's application. 我实际上是在尝试改善其他人的应用程序。 Thanks guys ! 多谢你们 !

暂无
暂无

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

相关问题 如何在C#windows窗体应用程序中轻松加密密码? - How to easily salt a password in a C# windows form application? 如何在devexpress GridControl中添加行,就像我们在普通的datagridview中添加行一样。 (WinForms C#) - How to add rows in devexpress GridControl just like we add rows in a normal datagridview. (WinForms C#) 如何将选定的行从sql数据库加载到C#中的DataGridView? - How to load selected rows from sql database to DataGridView in C#? 在 C# Windows 表单应用程序中找不到 DataGridView - Can't Find DataGridView in C# Windows Form Application C#如何使用重置按钮搜索后像第一次加载表格一样重新加载datagridview - C# How Can i reload datagridview like first load form after search with reset button 如何在不使用saveFileDialog C#Winforms提示用户的情况下将dataGridView轻松保存到.XLS或.CSV? - How can I easily save dataGridView to .XLS or or .CSV without prompting user with saveFileDialog C# Winforms? Datagridview刷新窗口C#桌面应用程序 - Datagridview Refresh window c# desktop application 如何生成随机的 1 位数字,然后将它们添加到 c# 窗口窗体应用程序中 datagridview 的每个单元格中? - How do i generate random 1 digit numbers and then add them in each cell of a datagridview in c# window form application? C#:在表单加载时datagridview值到文本框 - C# : datagridview value to textbox on form load 如何在C#中向DataGridView控件添加行? - How can I add rows to a DataGridView control in C#?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM