I need to do some simple (or so it seems) databinding and CRUD type operations on an ASP.Net page. I'm using a LinqDataSource connected with a FormView. The table that i'm trying to insert into has default contraints for these fields:
[Created] [datetime] NOT NULL
[CreatedBy] [nvarchar](50) NOT NULL
[Modified] [datetime] NOT NULL
[ModifiedBy] [nvarchar](50) NOT NULL
ALTER TABLE [dbo].SolutionComponent ADD CONSTRAINT [DF_SolutionComponent_Created] DEFAULT (getdate()) FOR [Created];
ALTER TABLE [dbo].SolutionComponent ADD CONSTRAINT [DF_SolutionComponent_CreatedBy] DEFAULT (suser_sname()) FOR [CreatedBy];
ALTER TABLE [dbo].SolutionComponent ADD CONSTRAINT [DF_SolutionComponent_Modified] DEFAULT (getdate()) FOR [Modified];
ALTER TABLE [dbo].SolutionComponent ADD CONSTRAINT [DF_SolutionComponent_ModifiedBy] DEFAULT (suser_sname()) FOR [ModifiedBy];
When doing an insert i'm getting a SQL Datetime overflow error because it's trying to insert a value into Created and Modified even though I have not bound anything to these fields.
My question is how can I get the LinqDataSource to omit these fields in the insert statement or at least supply dbnull or null to allow database level defaults to take over?