I have a database that I have restored on SqlExpress from a bak file which was located on my SQL Server Pro instance. I am using Linq to interact with the database and am able to query and update some of my tables (i havent tried them all). However, I have at least one table that will not accept any kind of update (my UserAddress table). If I run this query
TestDataContext td = new TestDataContext();
UserAddress ua = (from u in td.UserAddresses
where u.UserID == 56
select u).Single();
ua.Address1 = "ffffffffffffuuuuuuuuuuu";
td.SubmitChanges();
nothing happens. No committed text in the database, no exception, nothing. This is my connection string (Data Source=SNEE\SQLEXPRESS;Initial Catalog=UsersDatabase;Integrated Security=True) although I have tried it with SQL Authentication and recieved the same result. Has anyone else ever experienced something like this? If so, what did you do to get it to work?
EDIT 1 After digging around in the desginer i noticed something odd. The address class looks like this
[Table(Name="dbo.UserAddress")]
public partial class UserAddress
however my user class looks like this
[Table(Name="dbo.User")]
public partial class User: INotifyPropertyChanging, INotifyPropertyChanged
I also noticed that the Extensibility Method Definitions are defined for User but not for UserAddress. What gives? Im sure this is the root of my problem but why did this occur. I tried to create a test datacontext and drag the table onto it again and it still wont create the necessary code.