Creating SQL Connections : SQL Server « ADO.Net « C# / CSharp Tutorial






using System;
using System.Data.SqlClient;

class MainClass 
{
  static void Main(string[] args)
  {
    SqlConnection MyConnection = new SqlConnection("Data Source=(local); Initial  Catalog = MyDatabase; User ID=sa;Password=");

    MyConnection.Open();
  }
}








32.5.SQL Server
32.5.1.Creating SQL Connections
32.5.2.Using DataTable Mappings