I've come across an error I'm not quite sure how to get rid of, I've got a listview with listview items making up the grid, I've got values coming from a database populating the cells however if there are any null values(in this case, there's null values in the date) it crashes my program. I'm not quite sure of a way to allow the listview to have null values in it, I figured it would default allow it but that's not the case.
itm.Text = m_Queue_rs.Fields(0).Value
itm.SubItems.Add(m_Queue_rs.Fields(1).Value)
itm.SubItems.Add(FormatAge(m_Queue_rs.Fields(2).Value))
itm.SubItems.Add(m_Queue_rs.Fields(3).Value)
itm.SubItems.Add(FormatCurrency(m_Queue_rs.Fields(4).Value))
itm.SubItems.Add(m_Queue_rs.Fields(9).Value)
itm.SubItems.Add(getReason(m_Queue_rs.Fields(17).Value))
itm.SubItems.Add(m_Queue_rs.Fields(6).Value)
itm.SubItems.Add(m_Queue_rs.Fields(10).Value)
itm.SubItems.Add(m_Queue_rs.Fields(7).Value)' This is where the error is occuring, it's fine if there's a value to put into the cell but once it becomes null it spits it out, I would like to know if there's a way for it to accept nulls.
itm.SubItems.Add(GetCodeTranslations("AuthQueueStatus", m_Queue_rs.Fields(8).Value))
Error is:
Overload resolution failed because no Public 'Add' is most specific for these arguments:
'Public Function add(text As String) As System.Windows.Forms.ListViewItem.ListViewSubItem':
Not most specifc
'Public Function Add(item as System.Windows.Forms.ListViewItem.ListViewSubItem) As System.Windows.Forms.ListViewItem':
Not most specific
This post has been edited by Criel: 16 February 2012 - 02:23 PM

New Topic/Question
Reply



MultiQuote





|