Hello,
I have a gridview in asp.net page where I am allowing users to update data in the gridview with textboxes and dropdownlist.
When a user hits submit button I am trying to delete existing records and insert new records When I try the below mentioned code it is throwing out errors. Right now I am not infront of the dev box thats the reason I am not able to post exact code. thanks in advance
Dim db as new empDataContext
Dim rw as gridviewrow
Dim empList as new List(of employee)
Dim emp as new employee
Try
empList=(from e in db.Employees
where e.deptid == txtdeptid.Text).toList()
if empList isnot nothing then
for each emp in empList
db.employee.deleteOnSubmit(emp)
next
db.submitChanges
end if
for each rw in Gridview1.rows
' Insert each row
next
Catch
End Try