用于SQL连接的WPF启动画面 [英] WPF Splash Screen for a sql connection

查看:73
本文介绍了用于SQL连接的WPF启动画面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的WPF应用程序中,我必须连接到远程服务器并检索/发送一些数据.

我希望在连接和通讯过程中显示一个初始屏幕,并且在经过一定时间且未产生任何结果后,将显示取消操作".

我希望有人可以指出正确的方向……我正在考虑通过线程监视器进行操作,但是我的应用程序非常简单小巧,我不想在如此复杂的事情上浪费时间.如果有一个简单的答案,我将不胜感激:-)

谢谢

解决方案

您可以使用 ^ ].在worker中运行查询将允许UI响应用户操作.

我也建议您检查数据库操作的瓶颈,因为在启动时必须使用启动屏幕,因为数据库操作会听起来像您执行的操作非常慢(至少与用户通常期望的相比). /blockquote>

In my WPF app I have to connect to a remote server and retrieve/send some data.

I would like a splash screen to show during the connection and communication process and that would show a "Cancel action" after a certain amount of time has passed and no result has been produced.

I was hoping someone could point me in the right direction... I was thinking about going by thread monitor, but my app is quite simple and small and I don''t want to waste time on something so complex. If there''s an easy answer I''d appreciate it :-)

Thanks

解决方案

You could use a BackgroundWorker[^] in your splash screen. Running the query in the worker would allow the UI to respond to user actions.

Also I''d suggest that you examine the bottlenecks for the database operations since having to use a splash screen at startup because of dataabse opertions sounds like the operations you execute are very slow (at least compared to what the user typically expects).


这篇关于用于SQL连接的WPF启动画面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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