I have a pretty simple table structure as shown below and the problem sounds strange to me. Although I decided to get around this, I would like to accept the opinion of experts.
I have two tables
Users UserName nvarchar(250) Primary Key FirstName nvarchar(50) LastName nvarchar(50) Registrations Id BigInt PrimaryKey User nvarchar(250) - Foreign to Users Table Date - DateTime Data I have is as follows. Users UserName FirstName LastName a Small A b Small B Registrations Id User Date 1 A 1/1/12 2 B 1/1/12
Note that Case of User is here Caps, it is valid in SQL, it accepts.
Now for the interesting part. I created EDMX, .Net 4.0 and now I am executing this code.
using (EFTestEntities context = new EFTestEntities()) { var item = context.Registrations.Where(id => id.Id == 1).FirstOrDefault(); Response.Write(item.User1.LastName); }
It just breaks with a Null error. Pointer User1 Null throws when I change the value of the ValueName Column column in the registration table a instead of A.
This link talks about several similar
This link is another similar issue.
Please share your answers why this behavior, Collation of my database is random. Have you encountered this?
Kusek source share