cannot cast

I thank you for answered my last question! The last answer solved a million and 1 things for me, thanks again. Again I'm using VB.net 2003. Now my problem is (I think) a bit more complex. I'm binding from a different table; this table has boolean values. It's still an access database. With these boolean values when I create the dataset I get error messages in the windows generated code saying 'convert is not member of boolean'. The code looks like this.

Public Sub SetKeyboardNull()
Me(Me.tableEquipment_Service_Log.Keyboardcolumn) = _ System.Convert.DBNull
End Sub

I've changed it simply to convert.dbnull and the error message goes away, however now when I'm binding these checkboxes...

pbndtemp = New Binding("checked", pdtscanner, "Keyboard")
CheckBox3.DataBindings.Add(pbndtemp)


I get the error message
'Additional information: Object cannot be cast from DBNull to other types.'
And it points to the second line above. So I guess I'm wondering two things, what is the correct binding property for the checkbox control and/or what's causing this error and why are there errors(in the automatic generated .net code) when I generate the dataset??

Thanks in advance,
JT

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories