views:

1144

answers:

5
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!

+1  A: 

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

Spikolynn
A: 

Have you tried using escape characters on the backslashes?

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" />

becomes

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" />
JB King
A: 

I tried escaping the '/'s... Unfortunately that didn't help. I have had this working form this location before. Not sure what has gone wrong. Has anyone ever seen this?

A: 

Try replacing: Integrated Security=True

With: Trusted_Connection=Yes

G Mastros
A: 

Thanks a lot everyone. My problem was actually with the connection string I was providing NHibernate configuration. It would appear that the local data file path should not be wrapped in 's or "s. Thanks for the replies.