Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListBox Showing Nulls

Status
Not open for further replies.

chezealot9

Programmer
Jun 17, 2003
50
0
0
US
Hey Guys, I have a listbox running off of a query that basically has two fields, a key field and a "combined" field with several fields concatenated, so I can show multiple things in the listbox. Im getting blank rows in my list box, in between rows of data and Ive isolated it to a problem with the concatenated field when one of the individual elements is null or blank etc., How can I get around these nulls so they either show up blank or something else etc.

Thankyou greatly for any help you can lend!!
 
I would probably try something like this:

if(Convert.IsDBNull(datareader["myField"])){
// concatenate with empty string
}
else{
// concatenate with value
}
 
If you grab everything in your query then just do something like this

select isnull(name,'') && isnull(sex,'')

can't remember joining operators right now...

dlc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top