/***************************************************** * Get the customer record ******************************************************/ string sSelectCommand = "select * from Customers where CustomerKey = 1"; SqlDataAdapter oDataAdapter = new SqlDataAdapter(sSelectCommand, oConnection); DSCustomer oDataSet = new DSCustomer(); oDataAdapter.Fill(oDataSet, "DSCustomer"); /***************************************************** * Or Create a new blank data set record ******************************************************/ //DSCustomer oDataSet = new DSCustomer(); // Add a blank row oDataSet.Tables[0].Rows.Add(); // Get a reference to the table DataTable oTable = oDataSet.Tables[0]; // Get the number of rows int iRowCount = oTable.Rows.Count - 1; // Get a reference to the new row DataRow oRow = oTable.Rows[iRowCount]; // Edit the column values oRow["CustomerName"] = "Someone Else"; oRow["CreditLimit"] = 15; // Save the changes to the dataset oDataSet.AcceptChanges(); // Create a command builder. SqlCommandBuilder oBuilder = new SqlCommandBuilder(oDataAdapter); // Update the changes to the backend oDataAdapter.Update(oDataSet, oDataSet.Tables[0].TableName);