locked
Dataset value inside the textbox in vb.net RRS feed

  • Question

  • User-1578974752 posted

    Here I am getting the value( for example 30  )in ds  .It is from a function . How to return the value in ds to a textbox?  Appreciate the help

    Dim ds As DataSet = New DataSet()

    oda.Fill(ds, "Data")

    ' TextBox14.Text =

    Return ds

    Wednesday, November 28, 2018 8:30 AM

Answers

  • User-1716253493 posted

    AFAIK, if it's in rows(0)(0) then ds.Tables(0).Rows(0)(0)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 28, 2018 8:52 AM
  • User61956409 posted

    Hi shsu,

    Here I am getting the value( for example 30  )in ds  .It is from a function . How to return the value in ds to a textbox?

    You can use the following code snippet to get value from DataSet and assign it to TextBox control.

    If ds.Tables(0).Rows.Count > 0 Then
        TextBox14.Text = ds.Tables(0).Rows(0).ItemArray(0).ToString()
    End If

    Test Result:

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 4, 2018 9:32 AM

All replies

  • User-1716253493 posted

    AFAIK, if it's in rows(0)(0) then ds.Tables(0).Rows(0)(0)

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 28, 2018 8:52 AM
  • User61956409 posted

    Hi shsu,

    Here I am getting the value( for example 30  )in ds  .It is from a function . How to return the value in ds to a textbox?

    You can use the following code snippet to get value from DataSet and assign it to TextBox control.

    If ds.Tables(0).Rows.Count > 0 Then
        TextBox14.Text = ds.Tables(0).Rows(0).ItemArray(0).ToString()
    End If

    Test Result:

    With Regards,

    Fei Han

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, December 4, 2018 9:32 AM