ASP.net ile connection nesnesini kullanarak sql server'a bağlanma
Bu derste ASP.net ile Connection Nesnesini Kullanarak Sql Server’a bağlanalım…
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; // SQL Server için namespace ekliyoruz.. public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlConnection sqlbaglanti = new SqlConnection("Data Source=FAIK; Initial Catalog=FaikGencGunluk; Integrated Security=True;"); sqlbaglanti.Open(); Response.Write("sql server veritabanına bağlantı gerceklestirildi...."); sqlbaglanti.Close(); } }