Jump to content

Sql Server Bağlantı Hatası


lamont
 Share

Recommended Posts

arkadaşlar mssql server baglanmak kodları yazdıgımda hiç bir tepki vermiyor çalıştır dedigimde hatada vermiyor herhangibi bir hata göremiyorum sorun nedir 

 kodlar

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace Sql_server_baglanama
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        

        private void Form1_Load(object sender, EventArgs e)
        {
            SqlConnection baglan = new SqlConnection("Data Source=(local); Integrated Security=True; Initial Catalog=deneme");
            baglan.Open();
            MessageBox.Show("Bağlandı ...");
        }
Link to comment
Share on other sites

  • Editor

bağlandığına dair bi tepki vermezki.

 

SqlConnection baglan = new SqlConnection("Data Source=(local); Integrated Security=True; Initial Catalog=deneme");
            baglan.Open();

if (baglan.State == COnnectionState.Open)
{
       // mesaj

}

bu şekilde denermisin.

Link to comment
Share on other sites

Visual Studio C# SQL Server Bağlantı hatasının Çözümünü  SQL Bağlantı nasıl Kurabilecegini Buldum Arkadaşlar kodları aşagıda veriyorum 

SqlConnection bag = new SqlConnection(@"Data Source=.\SQLEXPRESS; database=veri; Integrated Security=True;");
        private void Form1_Load(object sender, EventArgs e)
        {
            bag.Open();
            label1.Text = "baglandı...";
            
        }

SQL Server Açarken Aldıgım Hatanın Çözümünüde Veriyorum Server Name Kısmına Aşagıdkai Gibi İsim Verirseniz Sorun Çözülecektir

 

localhost\SQLEXpress

Edited by lamont
Link to comment
Share on other sites

  • 1 ay sonra...

arkadaşlar sql server bağlantı hatası alıyorum ismini degiştirdim servisleri kontrol ettim olmadı bunu sebebi nedir sql server açamaıyorum ?

 

 

İlgili resminde yer alan Server Name kısmına yazmış olduğun (local) Yazısını sil onun yerine .\SQLEXPRESS  veya açılan sekmesinde yer alan Browse For More seçeneğine tıklayıp Local Servers > Database Engine alt sekmesinde yer alan ilgili kullanıcı adını seç ve Connect butonuna bas.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...