如何缩短Windows窗体的加载时间. [英] How to improve the loading time of a windows form.

查看:85
本文介绍了如何缩短Windows窗体的加载时间.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我一直在用c#做一个图书馆管理系统.但是最近,表格的加载时间大大增加了.

表单仅由一个datagridview组成,其中很少有从数据库填充的条目.
数据库也仅包含12个表.

任何人都可以建议提高加载表单的效率吗?

在此先感谢.

Hi All,

I have been doing a library management system in c#. But recently, the loading time for the forms have drastically increased.

The forms simply consists of a datagridview with few entries populated from database.
Database also consists of 12 tables only.

Can anyone suggest to improve the efficiency for loading the forms??

Thanks in Advance.

推荐答案

可能的原因可能是:
1.增加数据库大小.
2.增加用户数量.
3.在服务器上添加了一些应用程序,导致您的应用程序出现性能问题.

我的建议是让您先检查一下.如果您的数据库是MS SQL,则可能可以使用SQL Profiler.如果一切正常,请尝试重新访问您的存储过程/查询,并查看其是否仍然有效或是否需要修改.


对于SQL事件探查器,您可以从此处开始
http://msdn.microsoft.com/en-us/library/aa173918%28v = sql.80%29.aspx [ ^ ]
http://www.techrepublic.com/article/step-by-step-an-introduction-to-sql-server-profiler/5054787 [
Possible reasons might be:
1. An increase in the size of the database.
2. Increase in the number of users.
3. Some applications have been added on the server(s), causing performance problems on your application.

My advice would be for you to check on those first. You can probably use SQL Profiler if your database is MS SQL. When all seems fine, try to revisit your stored procedures/queries and see if its still efficient or if it needs modification.


For SQL Profiler, You can start here
http://msdn.microsoft.com/en-us/library/aa173918%28v=sql.80%29.aspx[^]
http://www.techrepublic.com/article/step-by-step-an-introduction-to-sql-server-profiler/5054787[^]
[/Edit]


仅" 12个表?可以,但是一次要查询多少数据.您存储的过程是什么样的.有多少个连接.你有什么索引.那只是数据库.
您可以使用启动屏幕来隐藏一些预加载或推迟一些数据加载,直到显示表单之后.也许一些多线程或后台处理
"Only" 12 tables? OK but how much data are you querying for at a time. What are your stored procs like. How many joins. What indexes do you have. That''s just the database.
You could use a splash screen to hide some pre-loading or defer some data loading until after the form is displayed. Perhaps some multi-threading or background processing


这篇关于如何缩短Windows窗体的加载时间.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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