有什么方法可以异步执行SqlCommand.ExecuteScalar()
,然后在执行时将其取消(以及在服务器端)?
.NET Framework 4.5 has a ExecuteScalarAsync() method.
See here: http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.executescalarasync(v=vs.110).aspx
ExecuteScalarAsync() also has an overload with a CancellationToken parameter that can be used to abandon the operation before the command timeout elapses.
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.