人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

May 13, 2007

新:.NET 2.0提供的异步数据访问

Filed under: SQL&DB Accessing

在connection string中指定 Asynchronous Processing = true.
Sample:
string strConn = “Data Source=.; Database=Pubs; Integrated Security=true; Asynchronous Processing=true”;
using (SqlConnection cn = new SqlConnection(strConn))
{
using(SqlCommand cmd = cn.CreateCommand())
{
cmd.CommandText = “”;
IAsyncResult ar = command.BeginExecuteReader();
// …
// do other processing
// …
SqlDataReader r = command.EndExecuteReader(ar);
}
}

参考
Asynchronous Command Execution in ADO.NET 2.0
http://msdn2.microsoft.com/en-us/library/ms379553(VS.80).aspx

Comments »

The URI to TrackBack this entry is: http://recordsome.blogsome.com/2007/05/13/p238/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham