sql - how to get a datatable to display it's data in a textbox -


everyone,

i trying textbox display result of "avg" select command sql server.

 dim querystring string = "select avg(pumpnum) petrol_table"          using adapter new sqldataadapter(querystring, connectionstring)              dim table new datatable             adapter.fill(table)              dim row datarow = table.rows(0)             textbox5.text = row("pumpnum").tostring 

if put column name in , error column name not exist. if leave out column name, in textbox "system.data.datarow."

thanks reading

while searching net answer, found this....

textbox5.text = table.rows(0).item(0) 

works charm. :-)


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -