Hi
You have written the code, for conneting SQL server ...
To test if a SQL Server is ready to process your SqlCommands is to OPEN a connection.
If that fails, it will Throw an exception. Then you know you can't go further.
Try the following code
try
{
_ConnectionString = "server=(local);Database=testdb ;UID=sa;password=sa1985;";
_Connection = new SqlConnection(_ConnectionString);
_Command = new SqlCommand();
_Command.CommandType = CommandType.StoredProcedure;
_Command.Connection = this._Connection;
_Connection.Open(); //Checks here.
}
catch (Exception Ex)
{
// Throw Exeption or View a Messagebox alert here
}
Hope it helps