[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 201
  • Last Modified:

NULL Table Values Not Displaying

I am displaying data from a table in SQL Server 2000, where the null columns do not display. What I mean is say three columns are City State ZIP. While City may show NYC, and ZIP 02108, the other column has not a cell when it is NULL. The cell disappears on columns with no data in the row. So the next row state may have data and the outline of the cell and data are there. any ideas? I have used access before and the frame of cells for the table appear regardless of data being present or not.
0
timokeeffe
Asked:
timokeeffe
  • 3
1 Solution
 
seanpowellCommented:
It depends on the situation, but cells may not appear if they are "entirely" blank, so you need to at least have the non-breaking space character in there ( )

As an example with code:

If IsNull(rs_main.Fields("State").Value) Then
    Response.Write("<td>&nbsp;</td>")
Else
    Response.Write("<td>" + rs_main.Fields("State").Value + "</td>")
End If

Or, simply include the &nbsp; in every cell. Depending on how you're justifying the text and spacing the cells, it may not impact your layout...

Response.Write("<td>&nbsp;" + rs_main.Fields("State").Value + "</td>")

That way, even if no value is returned, the cell won't be blank.

Thanks,
Sean
0
 
seanpowellCommented:
Hi Tim,

Any luck so far?

Thanks,
seanpowell
0
 
seanpowellCommented:
Just checking in on you :)
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now