3
Reply

data adapter does not update

eksypnos123

eksypnos123

Oct 26 2004 12:42 PM
2.1k
SqlConnection con=new SqlConnection("Data Source=real\\real;Initial Catalog=Northwind;Integrated Security=SSPI;"); string sql1="Select * from Employees"; SqlDataAdapter da=new SqlDataAdapter(sql1,con); SqlCommandBuilder cb=new SqlCommandBuilder(da); DataSet ds=new DataSet(); da.Fill(ds,"Employees"); ds.Tables[0].Rows[0]["LastName"]="Smith"; ds.AcceptChanges(); da.Update(ds,"Employees"); I execute the above simple code and yet the tables Employess from Nortwind database is not updated. I get no errors. I have followed the example from the documentation of SqlCommandBuilder.

Answers (3)