I have the following code:
using (var context = new DataContext("SiteSQLServer",Transaction.Begin))
{
var job = new DataObject<omv_JobSeekerReferences>();
int cntr = 1;
foreach (var item in ViewState)
{
omv_JobSeekerReferences r = (omv_JobSeekerReferences) ViewState["item_" + cntr];
var newRefRow = new omv_JobSeekerReferences { UserId = r.UserId,Company = r.Company, FromDate = r.FromDate, ToDate = r.ToDate };
job.Insert(newRefRow); // add the new row to the table
cntr++;
}
}
It blows on job.Insert complaining that it can't find the connection string "Default".
Am I doing something wrong? It works fine if I add a default connection string and the row is inserted.
I have the following code:
It blows on job.Insert complaining that it can't find the connection string "Default".
Am I doing something wrong? It works fine if I add a default connection string and the row is inserted.