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:

  1. Under Solution Explorer > right-click on the database in your solution > select View in Object Explorer
  2. Under your SQL Server Object Explorer, expand the SQL Server item
  3. 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.
    Example of locating your LOCALDB



Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s