I try to add entity-framework to console application: I press "add new item" and
then
then
then I added code:
class Program
{
static void Main(string[] args)
{
try
{
Database1Entities db = new Database1Entities();
db.AddToTableTest(new TableTest { name = "name" });
db.SaveChanges();
int count = db.TableTest.Count();
int ui = 9 + 0;
}
catch (Exception e)
{
}
}
}
It gives no error, but I don't see any changes in database. I described the issue better here
try / catch
, then you'll only find out about the exception at the catch block. If you don't have it at all, but you're debugging, you'll instead find about about it on the line that errored, so you can see what's wrong with it. (There are options in VS to change this behavior, but that's the default) – Kenyon