DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Display Information in Label

  1. #1
    Join Date
    Nov 2006
    Posts
    8

    Exclamation Display Information in Label

    what code should i need to display the data retrieve from database inside a label? for example : when i select the date jan 25 2006 then the data with the same date will display inside the label. now i can only display out the grid view of the data but dunno how to show it inside a label. i have try many ways but still cant work out. can anyone tell me please, thanks...

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    How are you retrieving the data from the database? Once you have the data in a variable, simply assign that variable to the Label's .Text property.
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Nov 2006
    Posts
    8
    i have try to assign value into it but still cant work out, can let me know what is the problem? thanks


    here is part of my code :

    Protected Sub reslist_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim DataSource1 As New SqlDataSource()
    DataSource1.ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ToString()

    DataSource1.SelectCommandType = SqlDataSourceCommandType.Text
    DataSource1.SelectCommand = "select from menu (today_menu, price, date) VALUES (@menu, @price, @date)"


    If reslist.SelectedValue = ListItem.FromString("sakura").ToString Then
    menulabel.Text = DataSource1.SelectParameters.GetValues("@menu")

    End If

Similar Threads

  1. Display information from remote XML
    By keneck in forum XML
    Replies: 0
    Last Post: 10-25-2006, 02:29 PM
  2. Replies: 4
    Last Post: 11-28-2005, 03:14 PM
  3. Replies: 0
    Last Post: 03-20-2002, 12:26 PM
  4. Replies: 0
    Last Post: 02-06-2002, 07:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center