borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Send email-Two Attachements)Next Topic (Too Many Tables) New Topic New Poll Post Reply
AndreaVB Forum : Database : Issues with tableadapter inserts
Poster Message
bradbritton
Level: Trainee

Registered: 16-02-2006
Posts: 1

icon 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

16-02-2006 at 09:37 PM
View Profile Send Email to User Show All Posts | Quote Reply
Goran
Level: Moderator

Registered: 16-05-2002
Posts: 1681
icon Re: Issues with tableadapter inserts

What error does it raise? Have you configured your data adapter's INSERT query?

____________________________
If you find the answer helpful, please mark this topic as solved.

17-02-2006 at 01:55 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : Issues with tableadapter inserts
Previous Topic (Send email-Two Attachements)Next Topic (Too Many Tables) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder