As i am working on a project in which i required to connect my database but i am unable to find connection class..
Plzz help me out as soon as possible!!!!!
Data base connection
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Pravin MoreRank #1,419 · 1.2K reputationPosted Nov 3, 2011, 8:35 PM EDT
there are many way for connect to database and perform oprations....
here i am giving sample ,hope it will help you......
SqlConnection con = dbcon.getcon("Data Source=yourSqlSERVERName;Initial Catalog=Databasename;Persist Security Info=True;User ID=Your ID;Password=xxxxx");
con.Open();
SqlCommand spcmd = new SqlCommand("Select * from Tablename", con);
SqlDataReader dr = spcmd.ExecuteReader();
while(dr.Read())
{
//Your Processing
}
Thanks,
Pravin.