bradbritton Level: Trainee
 Registered: 16-02-2006 Posts: 1
|
Issues with tableadapter inserts
The following code will insert data into the table, but will not commit the data to the database. Help!!!
CustomerTableAdapter1.Fill(RockDataRentalsDataSet1.CUSTOMER)
Dim newCustomerRow As RockDataRentalsDataSet.CUSTOMERRow
newCustomerRow = RockDataRentalsDataSet1.CUSTOMER.NewCUSTOMERRow
newCustomerRow.Cust_ID = Convert.ToInt32(txtCustNum.Text)
newCustomerRow.Cust_Name = Convert.ToString(txtCustName.Text)
newCustomerRow.Cust_Address = Convert.ToString(txtCustAddr.Text)
newCustomerRow.Cust_City = Convert.ToString(txtCustAddr.Text)
newCustomerRow.Cust_State = Convert.ToString(txtCustProv.Text)
newCustomerRow.Cust_Postal = Convert.ToString(txtCustPostal.Text)
newCustomerRow.Cust_Phone = Convert.ToString(txtCustPhone.Text)
newCustomerRow.Cust_Contact = Convert.ToString(txtCustContact.Text)
newCustomerRow.Cust_Alt_Contact = ""
RockDataRentalsDataSet1.CUSTOMER.Rows.Add(newCustomerRow)
CustomerTableAdapter1.Update(RockDataRentalsDataSet1.CUSTOMER)
newCustomerRow.AcceptChanges()
RockDataRentalsDataSet1.AcceptChanges()
Thanks,
Brad
|