Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Introducing Windows Azure- P55:The cloud platform is getting more and more attractive to the computing world. Today, service-oriented architecture (SOA) and aspect-oriented programming (AOP) techniques are widely used in enterprise solutions. A question an IT management team or a software development team may ask is, what is the next trend going to be? Cloud computing seems to be the right answer. | CHAPTER 8 SQL AZURE DateTime connectingStart DateTime.Now int timeout 0 while connection.State ConnectionState.Connecting timeout 1 DateTime timeNow DateTime.Now TimeSpan timespanElapsed new TimeSpan timeNow.Hour - connectingStart.Hour timeNow.Minute - connectingStart.Minute timeNow.Second - connectingStart.Second timeout TimeSpan.Compare timespanElapsed timeOutSetting private void CloseConn lock connection while null connection connection.State ConnectionState.Broken connection.State ConnectionState.Open connection.Close endregion region Public Methods public void BeginTrans if connection.State ConnectionState.Closed connection.State ConnectionState.Broken CloseConn OpenConn transaction connection.BeginTransaction public void CommitTrans if null transaction transaction.Commit CloseConn transaction null public void RollBackTrans 268 CHAPTER 8 SQL AZURE if null transaction transaction.Rollback CloseConn transaction null public SqlDataReader GetDataReader SqlCommand command try OpenConn command.Connection connection command.Transaction transaction command.CommandTimeout COMMAND TIMEOUT return command.ExecuteReader CommandBehavior.CloseConnection finally if transaction null RollBackTrans command.Dispose public Object ExecuteNonOuery SqlCommand command OpenConn command.Connection connection command.Transaction transaction command.CommandTimeout COMMAND TIMEOUT try int rowsAffected command.ExecuteNonOuery return command.Parameters.Contains @ReturnValue Convert.ToInt32 command.Parameters @ReturnValue .Value rowsAffected finally if transaction null 269 CHAPTER 8 SQL AZURE RollBackTrans command.Dispose public string ExecuteScalar SqlCommand command try OpenConn command.Connection connection command.Transaction transaction command.CommandTimeout COMMAND TIMEOUT return command.ExecuteScalar .ToString finally if transaction null RollBackTrans command.Dispose public DataSet ExecuteDataSet SqlCommand command DataSet oDataSet new DataSet try SqlDataAdapter da oDataSet.Locale .