Hi all
I am editing the data in the table employee through form 'employee master'. I am getting the error "Object Reference not set to an instance of object" . I am not able to make it out why I am getting this error here although i have initialized the value. I am enlcosing my code below.
txtempname.Enabled = True
cbxtype.Enabled = True
dt = DataSet21.Tables("employee")
dr = dt.Rows.Find(emp_lid)
emp_lid = dr("emp_lid")
dr.BeginEdit()
dr(0) = emp_lid
dr(1) = txtempname.Text
dr(2) = cbxtype.Text
dr.EndEdit()
OleDbDataAdapter1.Update(DataSet21, "employee")
txtempname.Enabled = False
cbxtype.Enabled = False
MsgBox("employee updated")
Can anyone tell me the correction in the above code?
I am editing the data in the table employee through form 'employee master'. I am getting the error "Object Reference not set to an instance of object" . I am not able to make it out why I am getting this error here although i have initialized the value. I am enlcosing my code below.
txtempname.Enabled = True
cbxtype.Enabled = True
dt = DataSet21.Tables("employee")
dr = dt.Rows.Find(emp_lid)
emp_lid = dr("emp_lid")
dr.BeginEdit()
dr(0) = emp_lid
dr(1) = txtempname.Text
dr(2) = cbxtype.Text
dr.EndEdit()
OleDbDataAdapter1.Update(DataSet21, "employee")
txtempname.Enabled = False
cbxtype.Enabled = False
MsgBox("employee updated")
Can anyone tell me the correction in the above code?