p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | 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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 19th, 2005, 09: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
__________________
Candle
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old April 19th, 2005, 09:22 AM
Friend of Wrox
Points: 657, Level: 9
Points: 657, Level: 9 Points: 657, Level: 9 Points: 657, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old April 19th, 2005, 03:36 PM
Imar's Avatar
Wrox Author
Points: 33,563, Level: 80
Points: 33,563, Level: 80 Points: 33,563, Level: 80 Points: 33,563, Level: 80
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 10,231
Thanks: 7
Thanked 203 Times in 201 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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #4 (permalink)  
Old April 20th, 2005, 03:01 AM
Friend of Wrox
Points: 657, Level: 9
Points: 657, Level: 9 Points: 657, Level: 9 Points: 657, Level: 9
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 <%#%>..

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #5 (permalink)  
Old April 20th, 2005, 03: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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 02:21 AM
Beginner :: Need help to bind the data in GridView kajal Visual Studio 2005 2 March 31st, 2007 05: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 09:45 PM



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


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc