Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program to test a SQL connection string? [closed]

Tags:

sql

I need a free and quick to download program that can test a connection string.

like image 719
JL. Avatar asked Sep 30 '09 09:09

JL.


People also ask

How can I tell if SQL connection is closed?

State == ConnectionState. Closed) { //Connection is closed } else { //Connection is open in some way } ? This way if the connection is null it's also "closed".


1 Answers

You can make one yourself in 20sec. For example in C#
- Create a new WinForms application
- Create a new SqlConnection(connectionString)
- Exception => Bad connection string
- All ok => Good connection string

SqlConnection conn = null;

try {
  conn = new SqlConnection("connection string here");
  conn.Open();
  // Good connection string
} catch (SqlException sqlE) {
  // Bad connection string
} finally {
  if (conn != null) conn.Dispose();
}
like image 104
Zyphrax Avatar answered Sep 20 '22 03:09

Zyphrax