I'm learning about ADO.Net entity framework, and I'm stuck at adding entity table object to the database.
I have a local database in solution called testDB. It has two columns - id(primary, unique, identiy),name(varchar(100)) and entity for it. The main application code is here below. Problem is, that using this code it doesn't add anything to the table, but also I'm not having any errors. What could go wrong?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace entityproject
{
class Program
{
static void Main(string[] args)
{
String someString;
someString = "Just a test";
testDBEntities tdbEntity = new testDBEntities();
test tblTest = new test();
tblTest.name = someString;
tdbEntity.test.Add(tblTest);
tdbEntity.SaveChanges();
}
}
}
App.config here http://pastie.org/6980938