|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
System.Data.NoNullAllowedException: Column 'frDateCreated' does not allow nullsHi guys!
I get this message when trying to insert a new record into a datatabel which is part of a dataset connected within VS 2005 (VB) from a datagridview control via a DataTableBindingSource and TableAdapter to an SQL Server. In the SQL server the field is declared as "do now allow null", BUT I put the getdate() function as default value so the field should be automatically filled with the current date. So why do I get that exception up there? Does SQL server test for NULL actually BEFORE inserting the default value? That would be rather stupid, wouldn't it? When I insert the record manually via the server explorer, the error does not occur. Martin Martin Widmer wrote:
Show quoteHide quote > Hi guys! When do you get the exception, when trying to insert into your local > > I get this message when trying to insert a new record into a datatabel which > is part of a dataset connected within VS 2005 (VB) from a datagridview > control via a DataTableBindingSource and TableAdapter to an SQL Server. In > the SQL server the field is declared as "do now allow null", BUT I put the > getdate() function as default value so the field should be automatically > filled with the current date. > > So why do I get that exception up there? Does SQL server test for NULL > actually BEFORE inserting the default value? That would be rather stupid, > wouldn't it? > > When I insert the record manually via the server explorer, the error does > not occur. > > Martin > > dataset or when trying to insert into the SQL server? My quess is your local dataset, which AFAIK, does not know your default values. Try setting the default value of the column you want on the datatable. That should clear up your issue. Chris
When I get the image from the file the file remains locked
Process that copies a prn file to a network printer under username Is MDI child open or not? Problem with SHAppBarMessage Impersonation without credentials ? BUG? SqlDecimal = Single/Double: 4.475 becomes 4.4749999999999996D ???? Generate reports programmatically with reporting services & SQL server 2005 DataTable.Expression VB.Net Setup Project Unwelcome forced pauses during code development in VS 2005 |
|||||||||||||||||||||||