I have the following SQL that creates a table and inserts the first row of data without any problems. By default, DateTime values ββare also inserted as expected.
CREATE TABLE Jobs (
[Id] int PRIMARY KEY IDENTITY(1,1),
[JobName] nvarchar(256) Default 'SomeName',
[CreateDate] DateTime DEFAULT GETDATE(),
[ModifyDate] DateTime DEFAULT GETDATE(),
[LastOpenDate] DateTime DEFAULT GETDATE(),
[CreatedByUser] nvarchar(64) Default 'SomeUser',
[Title] nvarchar(256) Default 'SomeTitle')
GO
INSERT INTO Jobs (JobName)
VALUES ('NewName')
GO
In Visual Studio 2008, I use the DataGridView and BindingNavigator controls. When I add a new line, the default values ββare not inserted, but zeros are inserted instead. I think this has something to do with the controls, but am not sure how to get the default values ββto be used.
Any ideas?
thanks
source
share