YouworkasanapplicationdeveloperatContoso.com.&en
YouworkasanapplicationdeveloperatContoso.com.YouuseMicrosoft.NETFramework3.5andMicrosoftADO.NETtodevelopanapplicationthatwillconnecttotheMicrosoftSQLServer2005database.Youthendefinetheconnectionstringoftheapplicationasfollows:
"Server=Prod;Database=WingtipToys;IntegratedSecurity=SSPI;AsynchronousProcessing=true"
Thefollowingcodesegmentisusedontheapplication:(Linenumbersareincludedforreferenceonly.)
01protectedvoidUpdateData(SqlCommandcmd){
02cmd.Connection.Open();
03
04lblResult.Text="Updating...";
05}
Youdiscoverthatthecmdobjecttakesalongtimetoexecute.Youwanttomakesurethattheapplicationcontinuestoexecutewhilecmdisexecuting.
Whatshouldyoudo?()
<img src='https://img2.soutiyun.com/shangxueba/ask/17127001-17130000/17129455/857dd6300a7e02c9aa6e71c9f2316c6b.jpg' />
时间:2024-04-06 11:24:28
相似题目