A1VBCode Forums

ASP.net


http://www.a1vbcode.com/vbforums/Topic26727.aspx

By raafishaafi - 1/14/2009

Hey,

I have a requirement, If in datatable the value of one column is null. I gotta show the value of other column in the same column.



For example:





id name descript descriptionType

1 ab doc

2 pd pdf

3 cd Business



Result should be



id name descript

1 ab doc

2 pd pdf

3 cd business.



Thanks in advance.
By TallOne - 1/15/2009

I'd take care of that on the backend.

SELECT

ISNULL(yourtable.ColumnA,ISNULL(yourTable.ColumnB,'BOTH ARE NULL')) AS ColumnA

FROM
yourTable

But there is a function called isdbnull you could probably use.

Good Luck