Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1092
  • Last Modified:

LINQ Insert with default values

Hi experts,

I access my database using LINQ. On some db fields I defined default values right on the database.
Now I want linq to use those default values if no other value is defined.
I found the property "auto generated value". I thought thats the solution, but whenever I try to insert now I get an error message (see screenshot - sorry its in german)

Can anyone help me?

1 Solution
Jens FiedererCommented:
Normally, when a database has default values on insert, those are the values used when you do an insert with NULL values on those columns.

I think the "auto generated value" is for sequence numbers.
arthrexAuthor Commented:
I googled a bit and found out that LINQ currently does not support default values.
So I did it the old fashioned way via an SQLConnection object...

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now