0

hi there,

Dim queryString As String = "select avg(pumpnum) from petrol_table"

            Using adapter As New SqlDataAdapter(queryString, connectionString)

                Dim table As New DataTable
                adapter.Fill(table)

                Dim row As DataRow = table.Rows(0)
                TextBox5.Text = row.ToString

as the code stands now, all i get in the textbox is "system.data.datarow"
the column called "pumpnum" is a type "int" in sql.

could someone please, show me where i am going wrong.

Thanks :-)

1
Contributor
1
Reply
6
Views
2 Years
Discussion Span
Last Post by westsiderailway
0

while searching the net for an answer, i found this...

TextBox5.Text = table.Rows(0).Item(0)

works like a charm. :-)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.