1

I am trying to switch my SQL database from one on server to local replica of another one. In my SQL Server Manager studio I've created and restored DB from DB bak file and fixed user settings. In my local umbraco project I have connection String that looks like this:

<connectionStrings>
    <remove name="umbracoDbDSN" />
    <add name="umbracoDbDSN" connectionString="server=PCMINJACL2;database=MySites;user id=MySites_user;password=password" providerName="System.Data.SqlClient" />
  </connectionStrings>

I am not sure if I am missing something, because everytime I try to open the site I get this error message: Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database.

Any suggestions what it can be, because everything from server name to user to password are set to correct ones. So, I have no idea why it is not working. Thanks in forward for any help.

Mindaugas
  • 1,173
  • 5
  • 15
  • 31
  • 1
    Have you tried logging in to the DB using those credentials? Is the DB in single user mode or something? – Joe Phillips Nov 23 '15 at 15:24
  • How should query look for that? It is my first interactions with SQL...so you know. – Mindaugas Nov 23 '15 at 15:55
  • Do you have SQL Server Management Studio (SSMS) installed? That is a GUI for interacting with the DB. You would just try logging in as that user, most likely – Joe Phillips Nov 23 '15 at 16:40
  • 1
    I would also suggest inspecting the connection string property in Visual Studio via Server Explorer. When you add this view [Server Explorer] to VS right click the Server DB instance and select 'Properties'. Another view should pop up, if you can connect to DB, and among the properties you will see 'Connection string'. – Marko Jovanov Nov 23 '15 at 18:03
  • Hi guys, feel real stupid, but my SQL connection properties were set to windows authentication only while I was trying to do SQL server login with server user and not windows credentials. After changing that setting everything worked like a charm. – Mindaugas Nov 25 '15 at 13:54

2 Answers2

0

so in my case what helped was replacing server=localhost;database=... in connection string with server=.\;database=... - it started to work right away.

avs099
  • 10,937
  • 6
  • 60
  • 110
0

You are facing this problem because of your connection string. I had this problem before. Based on the machine on which your SQL Server database is located there you should change your connection string. First You can use this way to make your connection. Then you can use the new connection string for sure.

  1. Open Visual studio--> View --> Server explorer
  2. Right-click on the Data connections--> Add Connection...
  3. In the Add Connection window you can try with different Data sources and server Ip addresses.

for my case,the windows was this

  1. Then you can press the Test connection button.
  2. After getting a successful message you can press the ok button.
  3. Then right-click on your connection and select properties. like this picture. enter image description here
  4. Then copy your connection string like this picture. enter image description here