Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 19th, 2005, 08:06 AM
Registered User
 
Join Date: Apr 2005
Location: Wuhan, Hubei, China.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to lsxx
Default how to bind a data()

Hi everyone!
How can we bind a data which is selected from a database to a control(not datagrid ,datalist or repeater) such as a Label or a Linkbutton control ?
for example,if I want to bind a picture to the linkbutton control,and the picture is stored in a database,so how shall I do?

Thanks in advance!


Candle
  #2 (permalink)  
Old April 19th, 2005, 08:22 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

You cant bind data from database to Label or LinkButton control.

  #3 (permalink)  
Old April 19th, 2005, 02:36 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
quote:Originally posted by Santhi
 You cant bind data from database to Label or LinkButton control.
You can't???

What about something like this:

<asp:Label id="lblTest" runat="server" Text='<%# SomeDatabindingExpression %>' />

Wouldn't that bind the results of SomeDatabindingExpression to the label?

Candle, are you trying to display a blob from the database, or did you store the *path* to the image in the database?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #4 (permalink)  
Old April 20th, 2005, 02:01 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Chennai, TamilNadu, India.
Posts: 326
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Santhi Send a message via MSN to Santhi
Default

Sorry Candle,as imar said you can bind data for label controls using databinding expression.But we can't directly bind as we do in DataGrid,DataList or repeater controls.You can put the database related operations in function and return the whatever value you want to bind to label control using <%#%>..

  #5 (permalink)  
Old April 20th, 2005, 02:35 AM
Registered User
 
Join Date: Apr 2005
Location: Wuhan, Hubei, China.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to lsxx
Default

thanks!
I did store the path of the image in the database,but cannot bind it to the linkbutton's imageurl property.maybe i can use a function.

Candle
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How ti bind data in dropdownlist? aaronabdiel ASP.NET 2.0 Basics 1 February 11th, 2008 09:28 PM
Beginner :: Need help to bind the data in GridView kajal ASP.NET 2.0 Basics 2 April 2nd, 2007 01:21 AM
Beginner :: Need help to bind the data in GridView kajal Visual Studio 2005 2 March 31st, 2007 04:26 PM
How to Bind Data in DataGrid akumarp2p C# 2005 2 December 30th, 2006 12:11 PM
How to bind data from a recordset to a combobox? wayne62682 Access VBA 6 April 2nd, 2006 08:45 PM



All times are GMT -4. The time now is 03:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.