For killing thread you can call the
Thread.Abort method like the following:
myThread.Abort();
For closing the SQL connection you can call the
SqlConnection.Close method or, wrap your code with a
using
block, like the following:
string connectionString = "Your connection string";
using (SqlConnection connection = new SqlConnection(connectionString))
{
connection.Open();
}