try{
vtBaglan.Open();
vtKomut.Connection = vtBaglan;
vtKomut.CommandText = "INSERT INTO projeler(xxxxxxxx) VALUES(xxxxxxx)";
vtKomut.ExecuteNonQuery();
vtBaglan.Close();
}
catch(Exception ex)
{
string error = ex.Message;
vtBaglan.Close();
}
Eğer herhangi bir sıkıntı olursa otomatik catch'e düşer ve error ile hatanın ne olduğunu görürsün.