Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Set Label Text Property with SQL SelectSet Label Text Property with SQL Select
Previous
 
Next
New Post
3/13/2007 7:12 AM
 
Hi,

I am very new to not only DNN but development in general and would really appreciate if anyone can help me with this question.
I have written a DNN module with help from the Nick Symmonds book on DNN Website creation in C#.  I have a combo box (cmbBox1) that when it is selected, it successfully performs a SQL call to the DB and populates a second combo box (cmbBox2).  Upon making a selection on cmbBox2 I wish to perform a select from the DB and set the Text property of two label controls on the same page based on data returned in the select.  The select will only ever return a single row.

Is it possible to manipulate the Label.Text property in C# based on fields retrieved from a single row in a SQL call?  If there is a better way to do this I would really appreciate a point in the right direction.  Thanks in advance.

Dave
 
New Post
3/13/2007 10:44 AM
 
Assuming you are using a DataReader (dr) it should be as easy as the below in the code-behind.

Label.Text = dr["field_name"].ToString();

You should reconsider how you are implementing this functionality however.  Multiple post-backs and dB calls on a page isn't user friendly. 
 
New Post
3/14/2007 9:30 AM
 
Thanks Shawn.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Set Label Text Property with SQL SelectSet Label Text Property with SQL Select


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out