Working with Entity Framework 4.1 with a SQL Server Express .mdf
database .
For test purpose I am trying to perform CRUD operations on SQL Server Express database using Entity Model in a WPF application .
I am new to this concept, and I followed the video tutorial and done coding according that
I created Entity model of single very simple table. And I wrote simple code in cs file to perform adding one row to the database using following code
testEntities db = new testEntities();
TestTable tb = new TestTable();
tb.Name = txtName.Text;
tb.Email = txtMail.Text;
db.TestTables.AddObject(tb);
db.SaveChanges();
But if I go back check the database no data is added. Please tell me whats going wrong here ??
And here is my connection String
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="testEntities"
connectionString="metadata=res://*/DBModel.csdl|res://*/DBModel.ssdl|res://*/DBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\test.mdf;integrated security=True;connect timeout=30;user instance=True;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>
</configuration>