Problem with LinQ to mySQL
Posted: Tue 13 Jul 2010 11:29
Hey
Using the latest dotConnect for mySQL.
I have created a lqml file and created a DataContext.
Each table has a timestamp field. And for example, one table called user. - This table has several fields and one field (called isLast) it has a default value direct in the database schema, with default value = 1, Allow NULL = True
When I create a "new user" This code was out of my mind now, so if there is something, wrong please exuse this.
The Problem is now the following:
1) I get an error, which tells me, that the timestamp field has not the right value, - So, I have specify it explicit.
2) The field value isLast = NULL and not like the default value in the database says: "1", I can't change the design, because "NULL" is a legal thing in my application. - What can I do?
THX
Using the latest dotConnect for mySQL.
I have created a lqml file and created a DataContext.
Each table has a timestamp field. And for example, one table called user. - This table has several fields and one field (called isLast) it has a default value direct in the database schema, with default value = 1, Allow NULL = True
When I create a "new user"
Code: Select all
Dim nUser as new DataContext.User With {.Name = "TEST"}
DataContext.User.InsertOnSubmit(nUser)
DataContext.SaveChanges
The Problem is now the following:
1) I get an error, which tells me, that the timestamp field has not the right value, - So, I have specify it explicit.
Code: Select all
Dim nUser as new DataContext.User with {.Name = "TEST", .Zeit = Now}
THX