0
Try
            If myCn.State <> ConnectionState.Open Then
                myCn.Open()
            End If
            If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Or TextBox4.Text = "" Or TextBox5.Text = "" Or TextBox6.Text = "" Then
                MsgBox("All Fields Are Required")
            Else
                strsql = "Update Prod set prod_name ='" + TextBox1.Text + "', comp_name = '" + TextBox2.Text + "',cost_item = '" + TextBox3.Text + "',mfg_date = '" + DateTimePicker1.Value + "',exp_date = '" + DateTimePicker2.Value + "',min_stock= '" + TextBox4.Text + "', max_stock='" + TextBox5.Text + "',stock_hand='" + TextBox6.Text + "'WHERE prod_num = '" + TextBox7.Text + "'"
                da = New OleDbDataAdapter(strsql, myCn)
                da.Fill(ds)
                'Me.Hide()
                'Form2.list()
                MsgBox("Saved")
                If myCn.State = ConnectionState.Open Then
                    myCn.Close()
                End If

            End If
        Catch ex As Exception
            MsgBox("Error in edit" + ex.Message)
        End Try

I have problem with this, I'm trying is to change the product details. But there is this error popping up when i'm trying to edit. error in editData type mismatch in criteria expression.

2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by Reverend Jim
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.