SterlinkArcher
SterlinkArcher

Reputation: 731

connection string in with a local db c# windows forms

I've created a database using Visual Studio 2015 by adding it locally as a mdf file

following this guide: Walkthrough creating a local database SQL Server Express

The exception that gets thrown is Format of the initialization string does not conform to specification starting at index 81.

I'm building a Windows Forms application.

My connection string looks like this string cs = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\TestDb.mdf;Integrated";

Upvotes: 0

Views: 5513

Answers (1)

bobek
bobek

Reputation: 8020

You can user Visual Studio's server explorer to connect to your DB and then you'll get the correct connection string:

http://www.c-sharpcorner.com/uploadfile/suthish_nair/how-to-generate-or-find-connection-string-from-visual-studio/

Upvotes: 2

Related Questions