Howdy, Stranger!

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

Categories

Please Help me!

jtmuzixjtmuzix Member Posts: 15
First let me make myself clear and say that Im not asking you to debug any code. Im using VS Studio.NET 2003. The language which Im working is VB.NET 2003. I have an access database using the JET OLEDB connection and data adapter type. I have created a program that will (sort of) manipulate this database.

This database has a few different tables. Just for examples sake let's say they are Scannerlog and Equiplog. Scannerlog table is just text fields that can be bound to textboxes without any problems (no problems here). However, the equiplog has text fields AS WELL as Boolean (yes/no) fields. I can bind the text fields to text boxes and vice versa, however Im having EXTREME difficulty getting checkboxes to correctly bind with the Boolean (yes/no) fields in the database. When binding Im using the checked control property and receive an error stating that I cannot cast DBnull to other types. Any ideas on what I can do to fix this issue?

One last question I have (isnt as critical) is that I have a search feature setup that can search the databases certain table for a certain string in a column and if the string is found it will do some operation form.show() . Which is what I want, EXCEPT, I would like it to fill the form with the correct strings and values according to the certain string I searched for. Lets say for example, I search for the string Bob in the Name Column. If Bob is returned then I want it to show the personal information form with all of bobs information (address, name, phone number, etc) in the appropriate textboxes respectively. As of right now I can get the form to display if bob is returned but none of Bobs information is in the textboxes. Any tips and/or advice would be greatly appreciated.
Thanks,
Jason T.

Comments

  • chriscorterealchriscortereal Member Posts: 8
    : First let me make myself clear and say that Im not asking you to debug any code. Im using VS Studio.NET 2003. The language which Im working is VB.NET 2003. I have an access database using the JET OLEDB connection and data adapter type. I have created a program that will (sort of) manipulate this database.
    :
    : This database has a few different tables. Just for examples sake let's say they are Scannerlog and Equiplog. Scannerlog table is just text fields that can be bound to textboxes without any problems (no problems here). However, the equiplog has text fields AS WELL as Boolean (yes/no) fields. I can bind the text fields to text boxes and vice versa, however Im having EXTREME difficulty getting checkboxes to correctly bind with the Boolean (yes/no) fields in the database. When binding Im using the checked control property and receive an error stating that I cannot cast DBnull to other types. Any ideas on what I can do to fix this issue?
    :
    : One last question I have (isnt as critical) is that I have a search feature setup that can search the databases certain table for a certain string in a column and if the string is found it will do some operation form.show() . Which is what I want, EXCEPT, I would like it to fill the form with the correct strings and values according to the certain string I searched for. Lets say for example, I search for the string Bob in the Name Column. If Bob is returned then I want it to show the personal information form with all of bobs information (address, name, phone number, etc) in the appropriate textboxes respectively. As of right now I can get the form to display if bob is returned but none of Bobs information is in the textboxes. Any tips and/or advice would be greatly appreciated.
    : Thanks,
    : Jason T.
    :
    :
    For the check box try binding the data to the actual field not the checked state. As far as filling the feilds with data from your selected
    member try this:

    [Code/]
    Private Sub cmbLastName_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmbLastName.SelectedIndexChanged
    'Fill data set and populate feilds on select
    If Me.cmbLastName.SelectedIndex <> -1 Then
    Me.DsCottage1.Clear()
    Me.daGuest.SelectCommand.Parameters("Last_Name").Value = Me.cmbLastName.Text
    Me.daGuest.Fill(Me.DsCottage1)

    End If
    End Sub
    [Code]

    This sub procedure is for a combo box that is bound to a seperate dataset. Fill the combo box data set in the load event or some other triger first then when you make a selection the other fields are filled.

    Oh yeah all your controls except the combo box should be bound to the same data set that is filled in the selected trigger event.
Sign In or Register to comment.