Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
TextBox1.Text = ComboBox1.SelectedValue
Me.Salary_tableTableAdapter.FillBy(Me.Emp_mngmtDataSet.Salary_table, empno:=TextBox1.Text)
End Sub
After Executing this. the program runs smoothly but when we close the program using the close window of the specific form. The Error Message pops up
"Conversion from string "" to type 'Integer' is not valid."
Please help me fix this.. Iam a novice...
Here is the full coding of the same form:
Public Class Form3
Private Sub Salary_tableBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Salary_tableBindingNavigatorSaveItem.Click
Me.Validate()
Me.Salary_tableBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.Emp_mngmtDataSet)
End Sub
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Emp_tableTableAdapter.Fill(Me.Emp_mngmtDataSet.Emp_table)
If TextBox1.Text <> "" Then
Me.Salary_tableTableAdapter.FillBy(Me.Emp_mngmtDataSet.Salary_table, empno:=TextBox1.Text)
ElseIf TextBox1.Text = "" Then
TextBox1.Text = ComboBox1.SelectedValue
End If
Me.Salary_tableTableAdapter.FillBy(Me.Emp_mngmtDataSet.Salary_table, empno:=TextBox1.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Form6.Show()
End Sub
Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
TextBox1.Text = ComboBox1.SelectedValue
Me.Salary_tableTableAdapter.FillBy(Me.Emp_mngmtDataSet.Salary_table, empno:=TextBox1.Text)
End Sub
End Class
Please help me what i have to do exactly...