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 8540781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:40:57+00:00 2026-06-11T11:40:57+00:00

I am currently working on my first website. The problem I have encountered is

  • 0

I am currently working on my first website. The problem I have encountered is the following: I have created a paged titled “CustomerList” that obviously list customers from an sql server DB. I have made the records clickable without using the select button that is included in the GridView. When I click a record, it takes me to my desired page. However, I can’t seem to find a way to write an sql query from that click event to my desired page. The following is my code for the click event:

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
    GridViewRow row = GridView1.SelectedRow;

    if (row.RowIndex == 0)
    {
        Response.Redirect("UsageHistoryPage.aspx? EntityID=" 
            + row.Cells[0].Text);
    }            
}

As you can see, when I click an index, I go to the “UsageHistoryPage”. I’ve also added row.cells.[0] to take that data and write it to the UsageHistoryPage, which in my case, would be the customers name at the top of the page. Can someone please help me with this? Does anyone have a good tutorial link? thanks.

  • 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-06-11T11:40:58+00:00Added an answer on June 11, 2026 at 11:40 am

    You can try with this code – Add this code on your UsageHistoryPage

    var input =  Response.QueryString["EntityId"];
    var connectionString = "...";
    
    var queryString = "SELECT Name FROM TABLE WHERE COLUMN=@EntityId";
    using (SqlConnection connection = new SqlConnection(
                   connectionString))
    {
        connection.Open();    
        using(var command = new SqlCommand(queryString, connection))
        {
            Command.Parameters.AddWithValue("@EntityId",input) 
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            while (reader.Read())
            {
                Response.Write(String.Format("For Rick Your Name is here{0}", reader[0]));
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a wee bit of a problem. I'm currently working on a website
I'm working on a website that hosts music, pictures, and videos. I currently have
I am currently working on my first website. I have no idea where to
I am currently working on a website, whose URL is http://lathamcity.com/ The problem that
Alright, so I'm working on a website and currently I have a shoutbox at
The website that I'm currently working on is having a few issues with Webkit
I have a problem that I want you to help me, I am currently
I have a problem with a Ext.Grid.EditorGridPanel, I am currently using ExtJS 2.3.0, that
I have implemented the following http://www.jacklmoore.com/notes/colorbox-with-json-or-flickr on my website and everything is working correctly.
I'm currently working on a website that imports XML data that we download from

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.