Problem with Combobox


Author
Message
Luiz Carneiro Lima
Luiz Carneiro Lima
StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)StrataFrame Beginner (25 reputation)
Group: Forum Members
Posts: 25, Visits: 87
Hi,

I have a combobox that it is populado thus:

---------

cbTipo.Items.Add(new DictionaryEntry("Pessoa F¡sica", "F"));

cbTipo.Items.Add(new DictionaryEntry("Pessoa Jur¡dica", "J"));

cbTipo.Items.Add(new DictionaryEntry("Prospect", "P"));

cbTipo.Items.Add(new DictionaryEntry("Internacional", "I"));

---------

This textbox is bind with a field string of the Business Object that in the data base keeps value “F”, “J”, “P”, “I”.

When I select an option of the Combobox gives an error of cast (Unable you cast object of type “System.DBNull” to type “System.String”.)

I already configured in the Customize wizard:

Return Alternate on Null/Set Null on Alternate (value type) = string. Empty

You can help me?

Attachments
erro.jpg (73 views, 221.00 KB)
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search