3 Replies - 1178 Views - Last Post: 09 November 2008 - 05:59 PM Rate Topic: -----

#1 4x4pirate  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 18-October 06

Database help.. saving customers to the database

Posted 09 November 2008 - 01:53 PM

HELP!!

Need some advice because I have been working at this database for hours and I cannot seem to get it to work.

I have attached my entire code in a Zip file (see attached)

Quick synapsis..

Upon entering the program, you can go to File, Form Customer Entry..
enter a customer and save and create Reservation..

All this does is move the text over to the new form.. nothing big.. You could easily just select Reservations from the main screen and type it all in manually..

I have bound all the required information to the appropriate table columns. Now I just want to be able to save the information to the tables in the database.

I really didn't want to use the binding navigator, but I cant get it to work as it is.. everything remains grayed out..

I have been racking my brains on this for the last few days.. any advice would be GREATLY appreciated.

Once I can figure out how to get the Reservations portion to update, I can figure out the rest.. I just can't seem to get it to work..

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: Database help.. saving customers to the database

#2 4x4pirate  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 18-October 06

Re: Database help.. saving customers to the database

Posted 09 November 2008 - 05:38 PM

im trying stuff like the Northwinds example located here:

http://msdn.microsof...034(VS.80).aspx

 Dim newCustomersRow As NorthwindDataSet.CustomersRow
newCustomersRow = NorthwindDataSet1.Customers.NewCustomersRow()

newCustomersRow.CustomerID = "ALFKI"
newCustomersRow.CompanyName = "Alfreds Futterkiste"

NorthwindDataSet1.Customers.Rows.Add(newCustomersRow)



But the example has to be wrong..

I try:



Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

		Dim newCustomersRow As CustomersDatabaseDataSet.CustomerTBLRow.NewCustomersRow()
		newCustomersRow = CustomersDatabaseDataSet1.CustomersTBLRow.NewCustomersRow()

		newCustomersRow.CustomerFName = (Me.txtFName.Text)
		newCustomersRow.CustomerLName = (Me.txtLName.Text)
		newCustomersRow.CustomerAddress1 = (Me.txtAddress1.Text)
		newCustomersRow.CustomerAddress1 = (Me.txtAddress1.Text)
		newCustomersRow.CustomerCity = (Me.txtCity.Text)
		newCustomersRow.CustomerState = (Me.txtSelectState.Text)
		newCustomersRow.CustomerZipCode = (Me.txtZip.Text)
		newCustomersRow.CustomerState = (Me.txtSelectState.Text)
		newCustomersRow.CustomerPhone = (Me.txtPhone.Text)
		newCustomersRow.CustomerEmail = (Me.txtEmail.Text)
		CustomersDatabaseDataSet1.CustomerTBL.Rows.Add(newCustomersRow)


I get CustomersDatabaseDataSet1 is not declared

HELP!!!! :( :crazy:
Was This Post Helpful? 0
  • +
  • -

#3 4x4pirate  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 18-October 06

Re: Database help.. saving customers to the database

Posted 09 November 2008 - 05:51 PM

am I supposed to be doing this?

CustomerTBLTableAdapter.Insert(Me.txtFName.Text, Me.txtLName.Text, Me.txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtSelectState.Text, txtPhone.Text, txtEmail.Text, txtZip.Text)
Was This Post Helpful? 0
  • +
  • -

#4 4x4pirate  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 54
  • Joined: 18-October 06

Re: Database help.. saving customers to the database

Posted 09 November 2008 - 05:59 PM

Sweet.. I love it when I solve my own problems.. WOOT

For anyone that is interested, my solution was

 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
		Try
			Me.CustomerTBLTableAdapter.Insert(Me.txtFName.Text, Me.txtLName.Text, Me.txtAddress1.Text, txtAddress2.Text, txtCity.Text, txtSelectState.Text, txtPhone.Text, txtEmail.Text, txtZip.Text)
			Me.CustomerTBLTableAdapter.Fill(CustomersDatabaseDataSet.CustomerTBL)
		Catch ex As Exception
			MessageBox.Show(ex.Message, "Data input error")
		End Try


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1