hi kamlesh try this code out
add this namespace first
using System.Data.SqlClient;
sqlconnection con = new sqlconnection();
con.connectionstring="Data Source=.;Initial Catalog=ur database name;Integrated Security=True";
con.Open();
con.Close();
use intelliscence help for writing name of the classes
What i feel kamlesh tat u might be closing a connection before any command executes
Please paste the code so that i can look and tell u.
Thanks & Regards
Radix :-\