Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7701281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:56:48+00:00 2026-05-31T22:56:48+00:00

In my ASP.Net webpage, I have a label and need the label’s text to

  • 0

In my ASP.Net webpage, I have a label and need the label’s text to be retrieved from my database.

I have no problem writing to my database, but it seems trying to retieve the data again is a mission…

What I need is to get the data from the Price column in my database, from the table Tickets, from the record where the ConcertName data is the same as my webpage’s title, or a string associated with my webpage.

I have tried many tutorials already, but all just throw me errors, so I decided to try one last place before I just give in and make my labels static.

In case it helps, I have tried the following:

First Try

Second Try

Third Try

Fourth Try

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:56:50+00:00Added an answer on May 31, 2026 at 10:56 pm

    Hopes you use c#

    string MyPageTitle="MyPageTitle"; // your page title here
    string myConnectionString = "connectionstring"; //you connectionstring goes here
    
    SqlCommand cmd= new SqlCommand("select Price from Tickets where ConcertName ='" + MyPageTitle.Replace("'","''") + "'" , new SqlConnection(myConnectionString));
    cmd.Connection.Open();
    labelPrice.Text= cmd.ExecuteScalar().ToString(); // assign to your label
    cmd.Connection.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm experiencing a very strange problem... I have a regular ASP.Net webpage with a
I have an ASP.NET webpage that is rendering many (~3000) <input type=text> textboxes on
I have a asp.net webpage that contain a custom login control like this: <div
I have a web page written in ASP.NET and I need to retrieve the
I need to loop through all controls on ASP.NET webpage. In configuration file I
Label1 (asp.net control) is located inside Panel1 of my webpage and I have a
I have an ASP.Net webpage where the user selects a row for editing. I
I have an asp.net webpage that only contains a textbox and a button. The
Using C#, ASP.Net In my webpage i have the link for the another web
We have an asp.net webpage that uses viewstate. During a lengthy operation (that takes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.