Okay, so after about an hour of searching through the web, I'm still having issues trying to create a local DB connection in ASP.net.
I need to create a connection to a local database file, and then simply loop through each record in a table. I'm not sure which file extension to use here (.aspx, .vbhtml, .cshtml?)
This is what I currently have from this W3school tutorial,
' Create local connection to DB file
@{
var db = Database.Open("Properties.mdf");
var query = db.Query("SELECT * FROM Properties");
}
<div id="pagewrap">
' Loop through records
@foreach(var row in query)
{
<p>@row.StreetAddress</p>
<p>@row.City</p>
<p>@row.State</p>
}
</div>
I'm currently getting a Connection string "Properties.mdf" was not found. error when running the above code. Any help is greatly appreciated.