.NET Returns blank if one db field is blank in concatenation

General discussion forum about all databases other than SqlBase.
a_sivababu
India
Posts: 503
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

.NET Returns blank if one db field is blank in concatenation

Post by a_sivababu » 16 Jun 2016, 07:44

Hello Support ,

In MS Sql Server 2008 R2,the Concatenated db fields returns null/blank if one of the concatenated field is null.This is happens in Odbc and Oledb .NET but not in Ado .NET

Version : TD .NET 6.3 SP1 UPD1
MS Sql Server 2008 R2
[img]
NullCombo.png
[/img]

In Sample, you can see this issues in expanded combo box and grid has all values.

Thanks!

Siva A
You do not have the required permissions to view the files attached to this post.

frevelundfey

Re: .NET Returns blank if one db field is blank in concatenation

Post by frevelundfey » 16 Jun 2016, 08:38

Hi Siva,
this is normal behaviour in SqlServer because it distinguish null strings (varchar) with empty strings.
You have solve it this way:
select isnull(SomeColumn, '') || isnull(SomeOtherColumn, '') from xyz;

Regards Thomas

a_sivababu
India
Posts: 503
Joined: 10 Mar 2017, 08:46
Location: Chennai,India

Re: .NET Returns blank if one db field is blank in concatenation

Post by a_sivababu » 16 Jun 2016, 09:20

Thanks Thomas for the workaround. we have also done the same thing but my doubt is that, it works in win32 and also for ado.NET. So I thought there is a issues in Gupta database API for Odbc.NET and Oledb.NET.

Gupta can confirm on this.

Thanks!
Siva A

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests