LLBLGEN Inserting black spaces in database...

Posts   
 
    
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 03-Feb-2012 22:40:23   

Hi,

I am using LLBLGen Pro 3.1, VS2010 & SQL 2008

I have table column defined char(9) null and trying to insert null value into this. I am passing Nothing in Entity but looks like database get 9 black spaces.

ORM Profile Values:

Ordinal Name DbType Direction Nullable Size Precision Scale Value Before Execution Value After Execution 58 @p59 AnsiStringFixedLength Input Checked 9 0 0

SQL Profiler

@p59=' '

why llblgen is inserting 9 black spaces in database?

Rishi

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 04-Feb-2012 05:13:13   

I can't reproduce that.

  • Please make sure you are using the latest LLBLGen runtime library version.
  • Are you setting any default values for that column in your DB?
  • Please post the code when you are inserting that.

For more info read Entities, NULL values and defaults.

David Elizondo | LLBLGen Support Team
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 06-Feb-2012 17:53:14   
  • Please make sure you are using the latest LLBLGen runtime library version. - I am using correct one.
  • Are you setting any default values for that column in your DB? - No Default value is set.
  • Please post the code when you are inserting that.

I have enclosed screen shot of code and sql script which are generated to insert the query.

daelmo wrote:

I can't reproduce that.

  • Please make sure you are using the latest LLBLGen runtime library version.
  • Are you setting any default values for that column in your DB?
  • Please post the code when you are inserting that.

For more info read Entities, NULL values and defaults.

Attachments
Filename File size Added on Approval
SQLQuery.sql 3,568 06-Feb-2012 17:53.27 Approved
Rishi
User
Posts: 69
Joined: 31-Oct-2011
# Posted on: 06-Feb-2012 17:54:30   

This is code how i am setting value.

employeeGeneralEntity.SpouseSsn = Nothing

Please see attachment for more detail.

Attachments
Filename File size Added on Approval
SavingEntity.png 48,499 06-Feb-2012 17:54.40 Approved
Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 07-Feb-2012 08:58:36   

The code snippet (screen shot) doesn't show how the field was set, but it shows a quick watch showing the field having an empty string not a null(nothing).

The following thread had a similar discusson which might turn useful to you: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=15043