简体   繁体   中英

Does Sql Server Compact Edition 3.5 query timeout?

我刚刚意识到SqlCeConnectionSqlCeCommand对象超时属性是readonly,默认值设置为0.这是否意味着对SqlCe数据库的查询永远不会超时?

No they do timeout , you can define the timeout in connection string like this

SqlCeConnection conn = new SqlCeConnection();
conn.ConnectionString = "Persist Security Info=False; Data Source = Northwind.sdf;" + 
"Password = <password>; server=mySQLServer;Connect Timeout=30";

This is whay MSDN has to say. ConnectionTimeout Property is the time (in seconds) to wait for a connection to open. The value is always 0 in SQL Server Compact as it is readonly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM