We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

binding data with label

Thread ID:

Created:

Updated:

Platform:

Replies:

48561 Aug 30,2006 07:14 PM UTC Nov 12,2006 07:26 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: FAQ
Administrator [Syncfusion]
Asked On August 30, 2006 07:14 PM UTC

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

Deepak
Replied On 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;