Merging Columns in One Column

raafishaafi

New member
Joined
Jan 14, 2009
Messages
1
Programming Experience
1-3
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:

VB.NET:
id | name | descript | descriptionType
1  | ab   |          |    doc 
2  | pd   | pdf      |
3  | cd   |          |   Business

Result should be

VB.NET:
id name descript
1 ab       doc
2 pd       pdf
3 cd       business.

Thanks in advance.
 
You can modify your SQL SELECT statement like this :

VB.NET:
SELECT Id, Name, ISNULL(Descript, descriptionType) AS Description

I you need the user to save this data though, you may have to keep two separate data models. A better idea might be to modify the data as it is displayed, but I do not have enough experience with Web Forms to help you out on this.
 
Back
Top