Create Sql Connection - CSharp System.Data.SqlClient

CSharp examples for System.Data.SqlClient:SqlConnection

Description

Create Sql Connection

Demo Code


using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Text;
using System.Collections.Generic;
using System;//w  ww .  j  a  v a 2  s . c o m

public class Main{
        public static SqlConnection CreateConnection()
        {
            return new SqlConnection(@"Data Source=LW\LW;Initial Catalog=sql;Integrated Security=True");
        }
}

Related Tutorials