binding data with label

hi all

how can i bind data in table with label control?
(label control is not inside any parent control, its an independent control in the webform.)

thanks

1 Reply

DE Deepak November 12, 2006 07:26 AM UTC

Simply use the label's text property with the data

for eg when u use the datareader to fetch the data from the database

use the following code


dim cmd as new Sqlcommand
cmd.commandType=commandType.text
cmd.connection =conn
cmd.commandText="Select name from EmployeeMaster"

dim rd as datareader
rd=cmd.executeReader()

if not isdbnull(rd.item("name"))
label1.text =(rd.item("name"))
endif

Thanks

Loader.
Up arrow icon