internal void GetLogMessage() { using (SqlConnection conn = new SqlConnection(AppSettings.GetConnectionString(this, "Log"))) { conn.Open(); { SqlCommand command = new SqlCommand(@"SELECT Message,ExceptionDetails FROM Log WHERE ServiceInstanceID=@InstanceID" ); command.Parameters.AddWithValue("@InstanceID", ServiceHistoryView.InstanceID); command.Connection = conn; using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { if (LogHeader == null) { LogHeader = new Dictionary <string, string>(); } string message = reader["Message"].ToString(); while (LogHeader.ContainsKey(message)) { message += " "; } LogHeader.Add(message, reader["ExceptionDetails"].ToString()); } } } } }
internal void GetLogMessage() { using (SqlConnection conn = new SqlConnection(AppSettings.GetConnectionString(this, "Log"))) { conn.Open(); { SqlCommand command = DataManager.CreateCommand(@"SELECT Message,ExceptionDetails FROM Log WHERE ServiceInstanceID=@InstanceID:bigint" ); command.Parameters["@InstanceID"].Value = ServiceHistoryView.InstanceID; command.Connection = conn; using (SqlDataReader reader = command.ExecuteReader()) { while (reader.Read()) { if (LogHeader == null) { LogHeader = new Dictionary <string, string>(); } LogHeader.Add(reader["Message"].ToString(), reader["ExceptionDetails"].ToString()); } } } } }