Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:45:48+00:00 2026-06-07T20:45:48+00:00

I have an LLBLGen entity. MyEntity{ public Decimal Foo; //Stored in database as a

  • 0

I have an LLBLGen entity.

MyEntity{
    public Decimal Foo;    //Stored in database as a NOT NULL field
}
....
public void SomeMethod(){
    MyEntity entity = new MyEntity();  //on initial inspection Foo reads as "0"

    adapter.SaveEntity(entity);  //will throw exception, "Foo can't be assigned a NULL value"
                                 //but on debug inspection, Foo = 0

    entity.Foo = 14M;
    adapter.SaveEntity(entity);  //will save ok.
}

If I don’t assign a value to a number, the debugger reads it as not null, however, it throws an exception telling me that it’s actually NULL.

I was trusting LLBLgen to auto assign all variables a default value, but I can’t be so sure now.

Anyone able to shed some light on this please. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:45:51+00:00Added an answer on June 7, 2026 at 8:45 pm

    The LLBLGen Pro runtime doesn’t assign default values automatically, however you can specify it as default constraints in your database.

    You can check if a field has a value assigned by checking the ‘Fields’ collection on your entity:

    bool isValueAssigned = myEntity.Fields[(int)MyFieldIndex.Foo].CurrentValue!=null;

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a good ORM for an upcoming project. The database will have
Have converted devise new session from erb to Haml but doens't work, this is
Have searched the database but need to specifically sum(of hours flown or days off)in
So, I have the following tables: Using LLBLGen 2.6 (Adapter Version - No Linq),
Have some code: using (var ctx = new testDataContext()) { var options = new
i have a generated domain model using LLBLGEN, and im validating those validation rules
I currently have two entities in LLBLGen and would like to merge them together
i'm struggling with LLBLGEN and i guess ORM's in general. i have created an
I'm using LLBLGen and I have some code like so: if (onlyRecentMessages) { messageBucket.PredicateExpression.Add(MessageFields.DateEffective
How can I make a nested select statment with LLBLGen? I have the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.