Re: Linq To Sql Issues :(
Hey,
What is the Data Type of that column in the Database?
Gary
Re: Linq To Sql Issues :(
DateTime
See this link,
http://stackoverflow.com/questions/8...und-or-changed
> # High precision datetime fields are used. The solution is to set
> UpdateCheck to never for that column
> your DBML file
This has resolved my issue but feel a bit like a hack.
I'm leaving this open to see what others think.
Re: Linq To Sql Issues :(
[20/10/2009 16:04:45] and [20/10/2009 16:04:45.390] are not equal dates. They differ by milliseconds. So when you do a compare ([SignUpDate] = @p5), you end up with no rows returned. So while comparing, you would either have to truncate the milliseconds part, or add the milliseconds part to the other so that they compare equal. I think the truncate approach would be easier than the add approach.
Re: Linq To Sql Issues :(
Quote:
Originally Posted by
Pradeep1210
[20/10/2009 16:04:45] and [20/10/2009 16:04:45.390] are not equal dates. They differ by milliseconds. So when you do a compare ([SignUpDate] = @p5), you end up with no rows returned. So while comparing, you would either have to truncate the milliseconds part, or add the milliseconds part to the other so that they compare equal. I think the truncate approach would be easier than the add approach.
Yes exactly. However I cant edit the Generated SQL as i'm using the Generated Object and methods. I can only see the SQL because I have used the DatabseContexts Log property.
Here is the actual code as in the first post,
Code:
var UserToEdit = this.GetUser(UserId);
UserToEdit.Forename = Fields["Forename"];
UserToEdit.Surname = Fields["Surname"];
UserToEdit.DateOfBirth = Convert.ToDateTime(Fields["DateOfBirth"]);
UserToEdit.DisplayName = Fields["DisplayName"];
UserToEdit.TelephoneNumber = Fields["TelephoneNumber"];
_db.SubmitChanges();
Pino.
Re: Linq To Sql Issues :(
Hey,
Agreed, it seems like a bit of a hack, but I am not aware of anything else to get round it.
Gary