Using
vb.net 2003,using a oleDBadapter Have a table in access database - tblEmployee.
Objective
Get the data for a employee using his or her EmpID
and change the status of the employee at run time
I have 2 buttons, btnLoad to load employee data, Update to modify the database tbl. 3 text Boxes, txtEmpId, txtEmpLastName, txtStatus
all 3 are bound to dsEmpMod1.tblEmployee
I have created the data adapter, dataset, and they are working
i used
daempMod.selectcommand.commandtext="search * from tblemployee where EmpID=" & "xxxxxxxxx"
dsempMod1.clear()
daempMod.fill(dsempmod1)
I have tested and dataset is loading.
when select command is executed, It populates 2 textboxes, txtMovieID and txtStatus. Status is changed to IN or Out depending on the employee state. Then this has to loaded back in tblEmployee
I have tried so many things and none working that frustration has clogged my mind.
after I change the dataset "status" value to new value to new status
daEmpMod.update(dsEmpmod1) gives error so as several other commands
daEmpmod.Update(dsEmpMod1) works fine if I have to add a new Row but when modifying a row gives error.
Can you tell me what do I do now. Please give the code syntex and explicit comments as I am a self tought beginer and not very good at it.
yvk