I am having trouble adding a new row of data into a table

CrzyPrgmr

New member
Joined
Nov 1, 2006
Messages
3
Programming Experience
1-3
Alright, I'm having major troubles adding information to a database. Actually, I think the information is being added, it just isn't stored. I am writing a billing systems program. I am working with a table called billtable. The info I am trying to store to the table come off of a form and are text boxes. Some of the fields are "Customer, Pick up and Drop off location, Dimensions of the freight being shipped..." After the user clicks a save button, this is the code that is being run through:

Dim newRow As BillingDataSet.billTableRow =
Me.BillingDataSet.billTable.NewRow()

newRow.customer = customer.Text
newRow.pickup = Pup.Text
newRow.dropoff = Doff.Text
newRow.driver = driver.Text
newRow.truck = truck.Text
newRow.pieces = pieces.Text
newRow.length = length.Text
newRow.width = widthbox.Text
newRow.height = heightbox.Text
newRow.POD = pod.Text
newRow.rate = rate.Text
newRow.fuelsur = fSur.Text
newRow.comments = comments.Text
newRow.dateadded = My.Computer.Clock.LocalTime.ToShortDateString

Me.BillingDataSet.billTable.Rows.Add(newRow)

The code on the right hand side of the store symbol is the text box text. On the left is the table fields. I used a VB.net snippet that added data to a table. Please tell me what is wrong with my code.:confused:

Sincerely,
Crzy Prgmr


 
Last edited:
You haven't shown the code where you save the data back to the dataBase.
Realize that ADO uses a disconnected architecture; the dataset is an in memory replication of the dataBase. You work with the dataset (inserting, modifying, ...) then you save the changes back to the dataSet through the use of a dataAdapter (tableAdapters are available in ADO.NET 2).
 
Friend

Hi Friend
Well u should try to insert data from insert query through Data set process
like
commandtext=" insert into tabelname values='" & textbox1.text & "','" & textbox2.text & "'" & ")"
etc
 
Oooo.. that way is so '90s, nay.. we had parameters in the '90s.. Make it '80s..

shakir, for the modern way we do database access in .NET, you can check out some tutorials microsoft wrote.. they are linked in my sig. Youre using .NET 1.1 so you will want to read the DW1 link..
 
Back
Top