var results = from c in context.Customers where c.City == "London" select c; SqlCommand cmd = context.GetCommand(results) as SqlCommand; DataTable dataTable = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dataTable);
var linqQuery = from c in context.Customers where c.City == "London" select c; SqlCommand cmd = context.GetCommand(linqQuery) as SqlCommand; DataTable dataTable = new DataTable(); SqlDataAdapter adapter = new SqlDataAdapter(cmd); adapter.Fill(dataTable); SqlCommandBuilder builder = new SqlCommandBuilder(adapter); adapter.InsertCommand = builder.GetInsertCommand(); adapter.DeleteCommand = builder.GetDeleteCommand(); adapter.UpdateCommand = builder.GetUpdateCommand();
dataTable.AcceptChanges() dataTable.Rows(1).Item(3) = "eeee" adapter.Update(dataTable)
Torna al forum | Feed RSS