C#nedir?com Homepage
Forum Home Forum Home > Veritabanları > SQL Server
  New Posts New Posts RSS Feed - SQL Database bağlanma sorunu
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SQL Database bağlanma sorunu

 Post Reply Post Reply
   

Author
Message
sephirot View Drop Down
Groupie
Groupie


Joined: 30 Haziran 2010
Status: Offline
Points: 61
Post Options Post Options   Thanks (0) Thanks(0)   Quote sephirot Quote  Post ReplyReply Direct Link To This Post Topic: SQL Database bağlanma sorunu
    Posted: 23 Şubat 2016 at 16:16
Arkadaşlar merhaba,

web sayfası için database bağlantısı yapmaya çalışıyorum. Bilgisayarımda bağlandım ancak kiraladığım vps te başaramadım. Nette çok araştırdım çıkan çözümleri yaptım ama hiçbiri işe yaramadı.

Özellikle 5 nolu madde için:
App_Data klasörüne network service için admin yetkisi verdim
SQL studio login kısmına sys admin erişim yetkisi verdim
sql database i c de ayrı bir klasöree taşıdım
SQL studio hem attach hemde detach olarak denedim.

Ama tamamında aynı hata vermeye devam etti. Yardımınıza ihtiyacım olup şimdiden teşekkür ederim

1 ) SqlConnection conn = new SqlConnection(@"Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\aaa.mdf;Integrated Security=True;");

 

System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections.

Note That this string works on local

 

2) SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aaa.mdf;Integrated Security=True;User Instance=True ;Initial Catalog=kres;");

    

System.Data.SqlClient.SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. 

3) SqlConnection conn = new SqlConnection(@"Data Source=PERFETTO2\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aaa.mdf;Integrated Security=True;User Instance=True ;Initial Catalog=kres;");

 

System.Data.SqlClient.SqlException (0x80131904): Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed. 


4) SqlConnection conn = new SqlConnection(@"Data Source = localhost;AttachDbFilename=|DataDirectory|\aaa.mdf;Integrated Security=True;");

Page is not opening

5) SqlConnection conn = new SqlConnection(@"Data Source=PERFETTO2\SQLEXPRESS;AttachDbFilename=|DataDirectory|\aaa.mdf;Integrated Security=True;");

 

System.Data.SqlClient.SqlException (0x80131904): CREATE DATABASE permission denied in database 'master'.An attempt to attach an auto-named database for file C:\HostingSpaces\sephirot\wwwroot\App_Data\aaa.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

 

Note: Same error after attaching or dettaching database from sql server management tool

Back to Top
sdgfs View Drop Down
Newbie
Newbie


Joined: 20 Ekim 2014
Status: Offline
Points: 39
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdgfs Quote  Post ReplyReply Direct Link To This Post Posted: 07 Mart 2016 at 11:07
Here you are able to look for Mens high street fashion for any girlfriend. Perhaps you have discovered that special girl that you simply can't get free from the mind?
Back to Top
EnisKurtay View Drop Down
Senior Member
Senior Member


Joined: 02 Ocak 2008
Status: Offline
Points: 342
Post Options Post Options   Thanks (0) Thanks(0)   Quote EnisKurtay Quote  Post ReplyReply Direct Link To This Post Posted: 08 Mart 2016 at 12:54
skype: eniskurtayyilmaz

Bir uzak destek ile beraber bir bakalım seninle.
Full Stack Developer | Co-founder CodeApp Co.

https://www.eniskurtayyilmaz.com

İzmir
Back to Top
ademturman View Drop Down
Newbie
Newbie


Joined: 18 Mart 2016
Status: Offline
Points: 9
Post Options Post Options   Thanks (0) Thanks(0)   Quote ademturman Quote  Post ReplyReply Direct Link To This Post Posted: 18 Mart 2016 at 10:55
"http://www.connectionstrings.com/sql-server/"

Server=myServerAddress;Database=myDataBase;User Id=myUsername;
Password
=myPassword;

Standart bağlantı tipini kullanmanızı öneririm.
Back to Top
 Post Reply Post Reply
  Share Topic   
   


Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.