Good day. I fill datatabla with values from base. datatabl I fill with values from 2 tables (I use the joint request). Datatable later changes, and these changes can not be made to the database. Errors in the process of the program does not occur, just the database is not updated. Please tell me what the problem is. Filling datatable data
sqlConnection = New SqlClient.SqlConnection("Data Source = *; User id = *; Password = *; database=* ;Integrated Security = False;") sqlConnection.Open() commandStrEmployee = "SEL ECT e.id_correspondent, e.surname, d.title,d.id_duty fr om Employee e inner join Duty d on e.id_duty=d.id_duty" adapterEmployee = New SqlDataAdapter(commandStrEmployee, sqlConnection) adapterEmployee.Fill(dtEmployee)
Data entry in datatable
Dim a As DataRow = Form1.dtEmployee.Rows(i) a.BeginEdit() a("id_duty") = Form1.dt_duty.Rows(b)("id_duty") a("title") = Form1.dt_duty.Rows(b)("title") a.EndEdit() a.AcceptChanges()
DB Update
Form1.adapterEmployee.Update(Form1.dtEmployee)
For some reason, the last line does not work.