阅读背景:

使用线程进行数据库操作的最佳方法是什么?

来源:互联网 

I'm developing a WinForms application with SQL Compact as main database. I was told i would NEVER mess with the UI Thread, every operation needs to be done outside the UI Thread.. going by this speech for every CRUD operation I create a thread and a progress bar appears, but I think this might not be the best way to do this, and I'm quite unsure of where and when to use threads along side with database operations. I'm not using the UI Thread to make these DB calls but i'm not seeing any problems if i would. To show the information to the user i make Invokes when needed (to show data on a grid or a combobox). Here is a small piece of code:I'm developing a WinForms application with SQL




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: