SQLCE Connections: Keep them open or let them close?

笑着哭i 提交于 2019-12-01 06:03:00

You should definitely watch Steve Lasker's PDC08 session about SQL Server Compact Edition. There's a part about performance, best practices and his own benchmarks (~37:00).

In short, keep it open, try to reuse commands, and use SqlCeResultSet for bulk operations.

For my device, I kept it open during the lifetime of the application. If the functionality of the application depends on the SQLCE connection throughout, this makes sense.

Get Late, Release Early. Open the Connection as late as possible in the operation, and close it as soon as is possible. Open SQL connections are not good.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!