Whats wrong with this picture :) Attempting to add a record to a table

I am trying to add a record to a table called TestQuote, I am not passing anything to field (0) because it is an auto-increment field (is that wrong) here is the code I am using could someone review it for me and maybe give me a idea how badly I am screwing things up :)

PS: I get no errors just nothing happens.

Thanks,

Terry

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim QTY As Integer = 0

Dim Pages As Integer = 0

Dim sig1qty As Integer = 0

Dim sig1val As Integer = 0

Dim sig2qty As Integer = 0

Dim sig2val As Integer = 0

Dim sig3qty As Integer = 0

Dim sig3val As Integer = 0

Dim WebHours As Decimal

Dim WebDollars As Decimal

Dim Description As String

Dim Price As Decimal

Dim dt As DataTable

dt = StrangDataSet.Tables("TestQuote")

Dim dr As DataRow

QTY = Integer.Parse(txtQTY.Text)

Pages = Integer.Parse(txtPages.Text)

sig1qty = Integer.Parse(txtSig1Qty.Text)

sig1val = Integer.Parse(txtSig1Val.Text)

Description = "Web Press"

txtDesc.Text = Description

WebHours = sig1qty * QTY / 18000

txtWebHrs.Text = WebHours

WebDollars = 78.81

txtWebDollars.Text = WebDollars

Price = WebHours * WebDollars

TxtTotal.Text = Price

'Insert

dr = dt.NewRow()

dr(1) = Description

dr(2) = WebHours

dr(3) = WebDollars

dr(4) = Price

TestQuoteTableAdapter.Update(StrangDataSet.TestQuote)

StrangDataSet.AcceptChanges()

End Sub



Answer this question

Whats wrong with this picture :) Attempting to add a record to a table

  • Jose Cabrera

    I am very new to VB so forgive my stupidity I do not have a clue what you are asking.


  • Zakspeed63

    Did you apply a command to the update Does the command have the proper SQL string Are the parameters for the command being set



  • Whats wrong with this picture :) Attempting to add a record to a table