G
Guest
I am trying to check for db connectivity during the onload event. To do this
I use the connection time setting from the connection string. It allows me
to set it higher than the default of 15, however if I set it to 5 for example
it defaults back to 15.
I am up for other ways to accomplish this task. Basically I am trying to
check for db connectivity and then update an xml file.
try
{
m_Connection = new SqlConnection("workstation id=\"BLUEMELJ-A\";packet
size=4096;integrated security=SSPI;data source" +"=\"(local)\";persist
security info=False;Connection Timeout=5;initial catalog=master");
MessageBox.Show(m_Connection.ConnectionTimeout.ToString());
m_Connection.Open();
}
catch (System.Exception ex)
{
MessageBox.Show("Catch");
m_Connection.Close();
}
I use the connection time setting from the connection string. It allows me
to set it higher than the default of 15, however if I set it to 5 for example
it defaults back to 15.
I am up for other ways to accomplish this task. Basically I am trying to
check for db connectivity and then update an xml file.
try
{
m_Connection = new SqlConnection("workstation id=\"BLUEMELJ-A\";packet
size=4096;integrated security=SSPI;data source" +"=\"(local)\";persist
security info=False;Connection Timeout=5;initial catalog=master");
MessageBox.Show(m_Connection.ConnectionTimeout.ToString());
m_Connection.Open();
}
catch (System.Exception ex)
{
MessageBox.Show("Catch");
m_Connection.Close();
}