By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,025 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Argument matching parameter 'item" cannot convert from 'DBnull' to 'ListViewSubItem'.

P: 1
Overload resolution failed because no Public 'Add' can be called with these arguments:
'Public Function Add(text as String)As System.Windows.Forms.ListViewItem.ListViewSubItem' :
Argument matching parameter 'text canot convert from 'DBNull' to 'String'.
'Public Function Add(item as System.Windows.forms.ListViewItem.ListViewSubItem) as
System.Windows.forms.ListViewItem.ListViewSubItem
Argument matching parameter 'item" cannot convert from 'DBnull' to 'ListViewSubItem'.
Aug 23 '14 #1
Share this Question
Share on Google+
1 Reply


IronRazer
P: 82
Hi,
The DBNull error basically means that there is Nothing being retrieved from the database. You have to have some kind of text in the ListView.Items.Add(String) method even if it is an empty string (""). It can`t be something that does not exist.

I am not a database guy but, i would say you need to retrieve your database information and check to make sure it is not DBNull before adding the ListViewItem. Otherwise, you would need to fill these database "items" with an empty string instead of giving them a value of DBNull when saving them to the database.
Aug 23 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.