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


Author
Message
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Glad we helped out, even if it was indirectly.  That's the whole reason we went with forum based support, so that people could peruse the topics and get some of their questions answered without having to ask them Smile
Edhy Rijo
E
StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)StrataFrame VIP (4.7K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I would like to thank Ricardo, Ben and Trent (I hope I did not miss anybody else in this thread) for this great thread. 

As a novice user of SF I am reviewing the previous posts, and then I found this one and by looking at the dedication of the SF developers to guide Ricardo to the correct path and even going the extra mile to provide detail code on how to accomplish Ricardo's request, confirmed that I made the right choice of becoming a member of the StrataFrame family.

I printed out this thread and was able to accomplish the same filtering of a data in a combo based on the selection of a previous combo and it worked the first time and without having to post a request for help.

Once again, thanks to the SF team!

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Good, I'm glad you got it.  Let me know if you have any questions.
Ricardo Quartier
Ricardo Quartier
StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)
Group: Forum Members
Posts: 87, Visits: 779
it runs now, Im trying to learn.. thanks Trent
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Got it...thanks.
Ricardo Quartier
Ricardo Quartier
StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)
Group: Forum Members
Posts: 87, Visits: 779
OK, I've sent to u... thanks
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
In the city combo box, how do you have the PopulationDataSourceSettings setup?  Ricardo, could you just ZIP up your Visual Studio solution and send it to me?  I can fix the problem and then send it back to you so you can see it and then you will know how to use it in the future.  Just send it to support@strataframe.net and I will keep my eye out for it. Smile
Ricardo Quartier
Ricardo Quartier
StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)
Group: Forum Members
Posts: 87, Visits: 779
Hi, now runs.. but the combobox of cities does not load... w00t

Should i change other part of the code?

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Ricardo,

Your fill method is wrong on the cities.  Try this instead:

Public Sub FillCityByState(ByVal StatePrimaryKey As Integer)
        Me.FillDataTable("SELECT * FROM tb_cidade WHERE cidade_estado_id = " & StatePrimaryKey.ToString())

The code you had referenced its own property which was causing the error you described.  Try this and let me know how it goes. Cool

Ricardo Quartier
Ricardo Quartier
StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)StrataFrame Novice (107 reputation)
Group: Forum Members
Posts: 87, Visits: 779
Thanks Rob that helped me to understand, but im still gettin' an error when i try to run... (so i must done something worng i guess)

This is what i done so far:

1 - On my cities BO, called (CidadesBO)

Public Sub FillCityByState(ByVal StatePrimaryKey As Integer)
        Me.FillDataTable("SELECT * FROM tb_cidade WHERE cidade_estado_id = " & EstadosBO.EstadosBOFieldNames.estado_id_cod.ToString())

'ESTADOSBO is the BO of states
End Sub

2 - On the Clubs form, called (frmCadClubes)

2.1 - City Combo

Private Sub cboCidade_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles cboCidade.ListPopulating
        e.Parameters(0).Value = EstadosBO.EstadosBOFieldNames.estado_id_cod

'ESTADOSBO is the BO of states
End Sub

2.2 - State Combo

Private Sub cboEstado_SelectedValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboEstado.SelectedValueChanged
        cboCidade.Requery()
End Sub

3 - I set the the Initialization as you told me.

But when i run, the code stops on this "requery line" and gives this message:

{"Invalid column name 'estado_id_cod'."} but this is the primary key of the table states, and that repeats on the field called "cidade_estado_id" on the cities table, so this is the link.

On the pic Im sending a diagram w00t maybe give some clue.

Please be patience BigGrin

Attachments
diagram.gif (134 views, 60.00 KB)
error.gif (137 views, 67.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