Click here to Skip to main content
15,746,420 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Am using List view to Display the data from Access DB,I Have some Feilds which Are Having No data(null) ... When i call those Feilds in my listview it dispalys blank space in few places, i want to dispaly without Blank space(if there is null)...plz give me solution...
For Example I Have a Address Feild,if it is empty it dispalys empty space....and it dispaly some address feilds,so idont want blank space if address not present...
Updated 14-Dec-12 19:27pm
Sergey Alexandrovich Kryukov 15-Dec-12 0:01am    
Not clear. What do you want to display instead of blank and why?
Member 9317669 15-Dec-12 1:12am    
For Example I Have a Address Feild,it it is empty it dispalys empty that case i want to avoid that Blank Space

You need to strip the null values from your data source. If they are there, they will be included when you data bind

SA - how can this possibly not be clear to you ?
Share this answer
U can also check for IsDBNull(),
If DB is null then don't show it in ur list,otherwise add it.
Dim Row_Number as Integer=0
For Row_Number = 0 To DGVMaster.Rows.Count - 1
 If Not IsDBNull(DGVName.Item("ColumnName", Row_Number).Value) Then
    'What here code to add data to list(Bcoz they will not blank in this block)
    'Write code in this block if DB is Null,then what u want.
 End If
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900