Show the amount of time it takes to complete a search
Remove Debug Messages Eliminate crash due to SQL connections The location for search result was changed from bullets to meaningful values.
This commit is contained in:
@@ -32,25 +32,34 @@ namespace VEPROMS.CSLA.Library
|
||||
#region Log4Net
|
||||
private static readonly log4net.ILog _MyLog = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
|
||||
#endregion
|
||||
private static string _DBServer = null;
|
||||
public static string DBServer
|
||||
{ get
|
||||
{
|
||||
get
|
||||
{
|
||||
try
|
||||
if (_DBServer == null)
|
||||
{
|
||||
string server = "";
|
||||
string db = "";
|
||||
Match m = Regex.Match(Database.VEPROMS_SqlConnection.ConnectionString, "Data Source=([^;]+)(;[^;]+)*;*Initial Catalog=([^;]+)(;[^;]+)*");
|
||||
if (m.Success && m.Groups.Count > 4)
|
||||
string cnstr = null;
|
||||
try
|
||||
{
|
||||
server = m.Groups[1].Value;
|
||||
db = m.Groups[3].Value;
|
||||
using (SqlConnection cn = Database.VEPROMS_SqlConnection)
|
||||
cnstr = cn.ConnectionString;
|
||||
string server = "";
|
||||
string db = "";
|
||||
Match m = Regex.Match(cnstr, "Data Source=([^;]+)(;[^;]+)*;*Initial Catalog=([^;]+)(;[^;]+)*");
|
||||
if (m.Success && m.Groups.Count > 4)
|
||||
{
|
||||
server = m.Groups[1].Value;
|
||||
db = m.Groups[3].Value;
|
||||
}
|
||||
_DBServer = string.Format("{0} - {1}", server, db);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
_DBServer = cnstr;
|
||||
}
|
||||
return string.Format("{0} - {1}", server, db);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return Database.VEPROMS_SqlConnection.ConnectionString;
|
||||
}
|
||||
return _DBServer;
|
||||
}
|
||||
}
|
||||
private static int _DefaultTimeout = 600; // 600 seconds, i.e. 10 minutes
|
||||
|
Reference in New Issue
Block a user