vb.net - Not able to fetch data from sql database in asp.net web application using vb -


i using below code fetch data sql, not getting error code not working on button click

dim strsql string = string.empty strsql = "select * jhg" using connection new sqlconnection         (configurationmanager.connectionstrings("xyz").connectionstring)     dim command new sqlcommand(strsql, connection)     connection.open()     reader sqldatareader = command.executereader()     while reader.read()         gridview1.datasource = reader     end while 'end connection , using close 

you need databind gridview after providing datasource:

gridview1.databind();


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -