Conversion from type 'DBNull' to type 'String' is not valid.


Author
Message
Ricardo Quartier
Ricardo Quartier
StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)
Group: Forum Members
Posts: 87, Visits: 779
Hello.. this is what I am doing now... Im trying to pupulate the combo box, but i'm gettin this error "Conversion from type 'DBNull' to type 'String' is not valid.". The funny thing is that I have a a text box that loads from the same BO and loads the same field, and it's working..

PS - I dont have any null info on the "nome_clube" field on the table.

Any Clues.. anyone?

Attachments
combobox_properties.gif (346 views, 77.00 KB)
dbnull_error.gif (370 views, 62.00 KB)
sql_data.gif (326 views, 63.00 KB)
textbox_properties.gif (343 views, 76.00 KB)
Replies
Ricardo Quartier
Ricardo Quartier
StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)StrataFrame User (145 reputation)
Group: Forum Members
Posts: 87, Visits: 779
Hi, Trent... me again.. now I can load comboboxes on all forms.. that makes me very happy... but can u please teach me how to save the data from a diferent table to the first?

Example: I have a form 1 to insert data from Clubs (soccer), then i load all the textboxes, from the table called (tb_clube), to insert, edit.. and been filled by a BO called "clubeBO", all okidoki like the example you guys made on the tutorial.

Then I inserted a new BO called "paisBO" (means country), and made the same fill method. If i put a combobox to load like u teach me, it brings all the countries... But the thing is that I want to insert on the clubs form this countries comboBox, to load the data from the coutries table and insert the value field (a primary key called pais_id_cod) on the country field on the clubs table.. and somehow, when i navigate the records, see the country that belongs to that team... instead of the value.... like 1, 2, 3....

Am I been anoying? BigGrin, not sure if it's even possible... but i guess it is... not sure how with strataframe... either...

If u got time, and nothing better to it... please drop a few lines.. (of code too) Cool

Best Regards...

Ricardo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Just to verify what you are attempting to do before I send you some code.  You have a combo box that you want to populate with the countries which is bound to a field in the clubs table, correct?  But when you bind and navigate right now it is showing a number (i.e. Primary Key or something) rather than the country description.  Also, I assume that your country database has a primary key and that primary key is tied to the clubs country field, correct?

Country Table                      Club Table
Primary Key - Integer  ----- ClubCountry - Integer
Description - String

The simple table above is just to verify that I understand your data structure and what you are attempting to do.  Please advise and let me know if I understand your situation.  Thanks.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Ricardo Quartier - 20 Years Ago
Ricardo Quartier - 20 Years Ago
StrataFrame Team - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
             Glad to help ;)
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
             Glad to hear it ;)
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Robert Linton - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
             Got it...thanks.
Trent L. Taylor - 20 Years Ago
Ricardo Quartier - 20 Years Ago
Trent L. Taylor - 20 Years Ago
Edhy Rijo - 19 Years Ago
StrataFrame Team - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search