new in .net programming... insert new row in the data table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • joel

    new in .net programming... insert new row in the data table

    Hi Guys ... I need some help on this... i know i've followed the right
    declarations on this.. or if not i may be close on hitting it. And i
    know there's something wrong with this code.


    This is what i did... it adds a new row into the data table... with
    values like department, sales glcode etc. when i click the insert/add
    button it creates a new row with the values on it. but the second time
    i try to insert a new row into the datatable,(via insert/add button
    click) it doesnt add another row instead it overwrites the first
    value inserted... i cant see where i went wrong or what is the right
    property to call (rows.add or what?).

    Any Help is very much appreciated!


    thanks!



    Dim i As Integer

    For i = 1 To 1

    Row1 = WarehouseDataTa ble.NewRow

    Row1.Item("Depa rtment") = "Department " & i

    Row1.Item("Sale s GL Code") = "Sales GL Code" & i

    Row1.Item("Cost of Sales") = "Cost of Sales" & i

    Row1.Item("Inve ntory") = "Inventory" & i

    Row1.Item("Expe nse GL Code") = "Expense GL Code" & i

    Row1.Item("Read er's Fee GL Code") = "Reader's Fee GL Code" & i


    Row1.Item("Depa rtment") = CStr(Me.cmbDepa rtment.Text)

    Row1.Item("Sale s GL Code") = (Me.txtSalesGLC ode.Text)

    Row1.Item("Cost of Sales") = (Me.txtCOSGLCod e.Text)

    Row1.Item("Inve ntory") = (Me.txtInventor yGLCode.Text)

    Row1.Item("Expe nse GL Code") = (Me.txtExpenseG LCode.Text)

    Row1.Item("Read er's Fee GL Code") = (Me.txtReadersF eeGLCode.Text)

    WarehouseDataTa ble.Rows.Add(Ro w1)

    Next


    Joel <----newbie!

  • Bond

    #2
    Re: new in .net programming... insert new row in the data table

    The exact solutions for your query will be found on the following URL



    This is the exact place from where your queries will be resolved


    jitesh tolar


    Comment

    • joel

      #3
      Re: new in .net programming... insert new row in the data table

      On Aug 31, 7:10 pm, Bond <G2jit...@gmail .comwrote:
      The exact solutions for your query will be found on the following URL
      >

      >
      This is the exact place from where your queries will be resolved
      >
      jitesh tolarhttp://www.intelcs.com/IT-Companies
      Thank you somuch for the info!

      Comment

      Working...