connetionString="Data Source=ServerName; Initial Catalog=DatabaseName;User ID=UserName;Password=Password"
using (var conn = new SqlConnection(connectionstring)) { // your sql magic goes here }