Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 9th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to add row to Dataset? [closed]
  2. Private Function LoadtoDataset(ByVal _type As String)
  3. Try
  4. Dim ds As New DSProducts
  5. Dim dr As DataRow
  6. dr = ds.Tables("DailyTransaction").NewRow
  7. dr("ProductCode") = ProdID
  8. dr("ProductName") = lblProductName.Text
  9. dr("Quantity") = txtQuantity.Text
  10. dr("Type") = _type
  11. ds.Tables("DailyTransaction").Rows.Add(dr)
  12. Me.DialogResult = Windows.Forms.DialogResult.OK
  13. 'Me.Close()
  14. Catch ex As Exception
  15. MessageBox.Show(ex.Message.ToString, "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  16. End Try
  17. Return Nothing
  18. End Function