How to creating a SqlConnection Object?
Sanjay Dixit
SqlConnection conn = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=DataBase_Name;User ID=UserID;Password=Password");
SqlConnection conn = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=Northwind;User ID=YourUserID;Password=YourPassword");
connetionString="Data Source=ServerName; Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
SqlConnection conn = new SqlConnection("Server=servername;database=databasename;uid=sa;pwd=urpassword");
SqlConnection con = new SqlConnection("Data Source=DatabaseServer;Initial Catalog=DataBase_Name;User ID=UserID;Password=Password");
SqlConnection conn = new SqlConnection ("data source=databaseserver; Initial catalog=DataBase_Name; Integrated Security=True;");
(1)Using System.Data.SqlClient; (2) SqlConnection con = new SqlConnection(); con.ConnectionString="Data Source=ABC;Initial Catalog=studentdetail;uid=sa; pwd=Password1";
(1)Add namespace Using System.Data.SqlClient. (2) SqlConnection con = new SqlConnection(); con.ConnectionString="Data Source=ABC;Initial Catalog=studentdetail;uid=sa; pwd=Pass1";