Connection String to Local DB file is not working

Nick picture Nick · Jan 28, 2009 · Viewed 7.2k times · Source
connectionString="AttachDbFilename=C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF;Integrated Security=True; User Instance=True"
     providerName="System.Data.SqlClient" />

This is the connection string that is provided to me from the Server Explorer for my local MDF file. I keep receiving the following error when attempting to run the application.

"Format of the initialization string does not conform to specification starting at index 25."

Anyone know what this is?

Thanks!

Answer

Spikolynn picture Spikolynn · Jan 28, 2009

I'd say it is the spaces in file name. Try enclosing it in '' e.g.

connectionString="AttachDbFilename='C:\Documents and Settings\nmartin\My Documents\PS_Upload\TimeTrack\src\TimeTracker\TimeTrack\App_Data\ASPNETDB.MDF';Integrated Security=True; User Instance=True"

or copy it to c:\ for a test