Member Avatar for westsiderailway

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 :-)

Member Avatar for westsiderailway

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

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

works like a charm. :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.