Member Avatar

hi there,

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

            Using adapter As New SqlDataAdapter(queryString, connectionString)

                Dim table As New DataTable

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

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

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

Thanks :-)

Member Avatar

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

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

works like a charm. :-)