I'm doing some basic db querying in WebMatrix.
Something like,
@{
var db = Database.Open("test"); //test is the name of my database
var selectQuery = "SELECT * FROM MY_CUSTOM_TABLE"
}
//Doing a `@foreach` and showing the items from the table
When I do the same thing in Visual Studio,
I get an error Connection String not found
at var db = Database.Open("test");
.
Am I missing some using
statements? or am I doing something utterly wrong?
First issue was,
I hadn't defined a connection string in my web.config.
I did that and it gave me an
Instance Error
.That took a while solving cause of weird escape sequence behavior. This helped me.