acnice
Member
please help me..when running this code it gives an exception called:The DataAdapter.SelectCommand property needs to be initialized.
this is my code:
Dim drEmployee As DataRow
drEmployee = dsEmployee.Tables("Employee").NewRow()
With drEmployee
.Item("empNo") = txtEmpNo.Text
.Item("empName") = txtEmpName.Text
.Item("empDOB") = dtpDOB.Value
.Item("Gender") = chrGender
.Item("deptNo") = cboDepartment.SelectedIndex + 1
.Item("empSalary") = txtSalary.Text
End With
dsEmployee.Tables("Employee").Rows.Add(drEmployee)
adEmployee.InsertCommand = cmdBuilder.GetInsertCommand
this is my code:
Dim drEmployee As DataRow
drEmployee = dsEmployee.Tables("Employee").NewRow()
With drEmployee
.Item("empNo") = txtEmpNo.Text
.Item("empName") = txtEmpName.Text
.Item("empDOB") = dtpDOB.Value
.Item("Gender") = chrGender
.Item("deptNo") = cboDepartment.SelectedIndex + 1
.Item("empSalary") = txtSalary.Text
End With
dsEmployee.Tables("Employee").Rows.Add(drEmployee)
adEmployee.InsertCommand = cmdBuilder.GetInsertCommand