Selasa, 04 Maret 2014

Connection Database With Visual Studio Using VB.NET & C#
APP.CONFIG
<connectionStrings>
    <add name="NAMECONN" connectionString="Data Source=SERVER;Initial Catalog=NAMADB;User ID=sa;Password=PASSWORD;Max Pool Size=300;Connect Timeout=300"
      providerName="System.Data.SqlClient" />
</connectionStrings>

FORM


using System.Data.SqlClient;
using System.Configuration;

--------
            string strsql = ConfigurationManager.ConnectionStrings["NAMECONN"].ConnectionString;
            SqlConnection conlog = new SqlConnection(strsql);
            conlog.Open();
Visual Studio 2010 & Devexpress