Click here to Skip to main content
15,067,250 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...
Posted
Updated 14-Dec-12 19:27pm
v2
Comments
   
Not clear. What do you want to display instead of blank and why?
—SA
Member 9317669 15-Dec-12 1:12am
   
For Example I Have a Address Feild,it it is empty it dispalys empty space....in 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 ?
   
U can also check for IsDBNull(),
If DB is null then don't show it in ur list,otherwise add it.
VB
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)
 Else 
    'Write code in this block if DB is Null,then what u want.
 End If
Next
   

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