what is the opposite action for Fill(dataset)
-
I want to get 1. get some data using a SqlDataAdapter from a query on db 2. close connection from db 3. fill a dataset and bind it to a control. 4. making updates on data and post it back to db update all rows back. but it must like saving an excel page. So what can be the best method. Is there anything like opposite action of a dataAdapter fill method.
// ACTION 1,2,3 SqlDataAdapter da; using (SqlConnection con = new SqlConnection(connectionString)) { cmd.Connection = con; con.Open(); da = new SqlDataAdapter(cmd) } ds = new Dataset(); da.Fill(ds) ... // bind the data to a control, may be a repeater // which has form inputs field for each row and field of data // user makes changes on data. // ACTION 4 ? update it back to db.
karanba
-
I want to get 1. get some data using a SqlDataAdapter from a query on db 2. close connection from db 3. fill a dataset and bind it to a control. 4. making updates on data and post it back to db update all rows back. but it must like saving an excel page. So what can be the best method. Is there anything like opposite action of a dataAdapter fill method.
// ACTION 1,2,3 SqlDataAdapter da; using (SqlConnection con = new SqlConnection(connectionString)) { cmd.Connection = con; con.Open(); da = new SqlDataAdapter(cmd) } ds = new Dataset(); da.Fill(ds) ... // bind the data to a control, may be a repeater // which has form inputs field for each row and field of data // user makes changes on data. // ACTION 4 ? update it back to db.
karanba
well yes, da.Update(ds) providing you specify an update command (i see you have specified a select command when initializing your data adapter)
---Guy H (;-)---