Hi,
I have the following SQL that creates a table and inserts the first row of data without a problem. The 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 am using the DataGridView and BindingNavigator controls. When I add a new row the default values are not inserted but nulls are inserted instead. I think this is something to do with the controls but not sure how to get the default values to be used.
Any ideas?
Thanks