My team and I were working through a tutorial to develop a SharePoint Online Add-In: Give your provider-hosted add-in the SharePoint look-and-feel.
We ran into an issue where the connection string to our LOCALDB was throwing a SQL error 50. The errors ranged from a “network connection” issue where the database could not be connected, then to a login error, where I could not authenticate onto the SQL server.
After some research, I discovered our machines were publishing the temporary database we’ve created on a different location that was specified in the tutorial files.
The tutorial connection string reads:
connectionString="Data Source=(localdb)\ProjectsV12;Initial Catalog....."
When on our machines, it should read:
connectionString="Data Source=(localdb)\ProjectsV13;Initial Catalog..."
This may not be the case for everyone’s LOCALDB problems. I discovered this using Visual Studio to view my database. Here’s what I did:
- Under Solution Explorer > right-click on the database in your solution > select View in Object Explorer
- Under your SQL Server Object Explorer, expand the SQL Server item
- Filter through each of the LOCALDB’s to find your database, then make note of where this is located, because this is the location where the the connection string must point.