Reputation: 76 Whiz
- Active Posts:
- 251 (0.17 per day)
- 22-April 11
- Profile Views:
- Last Active:
- Aug 01 2014 11:01 PM
- OS Preference:
- Favorite Browser:
- Favorite Processor:
- Favorite Gaming Platform:
- Your Car:
- Dream Kudos:
Posts I've Made
Posted 26 Jul 2014A guru will probably want to see the latest version of the connnection-string you are attempting. In particular, you need to double-up on all the back-slashes in a normal string, or precede the string with @ to create a verbatim string literal @"like\ this".
Anyway, good luck.
Yeah, I've escaped all the backslashes. Hopefully someone who has worked with these before will show up.
Posted 26 Jul 2014This (LocalDB\v11.0); is different to this (LocalDB)\v11.0;.
I believe you also actually type '|DataDirectory|', not App_Data.
The site you linked actually shows two different versions, I'll try it with the closing parantheses further to the left.
QuoteI've been reading documentation and tutorials for two days to no avail.
How so? You only mentioned recently that you didn't consider the need for a connection string />/>
As I said, the documentation stated that the server would first look for the db name (without the extension) in App_Data first before looking for connection strings in the webconfig.
Edit: When using |DataDirectory| I get an "Illegal Character" error. Replacing (LocalDB\\v11.0) with (LocalDB)\\v11.0 just gives the same error as before. I guess I'll just have to wait for the gurus to get back on :\
Posted 26 Jul 2014Database.Open() can receive the connection string, but regardless I get an error now that I didn't get before when just opening "db".
Connection string "Data Source=(LocalDB\v11.0);AttachDbFileName=App_Data\db.mdf;InitialCatalog=db;IntegratedSecurity=True;MultipleActiveResultSets=True" was not found.
Any ASP.NET gurus around that can explain how this is supposed to work, I've been reading documentation and tutorials for two days to no avail.
Posted 26 Jul 2014What does your connection-string look like? Presumably this is in your Database.Open() method.
I'm sad to say I was under the assumption that a db would be found in the App_Data folder without the need for a connection string. I'll try fixing that using what you gave me for a local db.
Edit: I want to confirm if this looks right:
var db = Database.Open("Data Source=(LocalDB\v11.0);AttachDbFileName=App_Data\db.mdf;InitialCatalog=db;IntegratedSecurity=True;MultipleActiveResultSets=True");
- Member Title:
- D.I.C Regular
- Age Unknown
- Birthday Unknown
- Years Programming:
- Programming Languages:
- C++, C#, FreeBasic, Java, Python