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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:00:59+00:00 2026-05-23T13:00:59+00:00

I am doing a web project in VS 2010 and I am quite new

  • 0

I am doing a web project in VS 2010 and I am quite new to programming. I was just wondering how to display the data from a datatable or dataset in the web page once button_click event is fired/clicked?

Please help!

  • 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-23T13:01:00+00:00Added an answer on May 23, 2026 at 1:01 pm

    Here is a quick code sample to get you started:

    ASPX

        <asp:Button runat="server" Text="Click Me" ID="btnSubmit" 
            onclick="btnSubmit_Click" />
        <asp:GridView runat="server" AutoGenerateColumns="false" ID="GridView1">
            <Columns>
                <asp:BoundField DataField="ID" />
                <asp:BoundField DataField="productName" HeaderText="Product Name" />
                <asp:BoundField DataField="unitCost" HeaderText="Cost"  dataformatstring="${0:F2}" />
            </Columns>
        </asp:GridView>
    

    C#

            public void BindData()
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("ID", typeof(int));
                dt.Columns.Add("productName", typeof(string));
                dt.Columns.Add("unitCost", typeof(decimal));
    
                dt.Rows.Add(1, "Pineapple", 1.45);
                dt.Rows.Add(3, "Apple", 1.45);
                dt.Rows.Add(17, "Orange", 6.33);
                dt.Rows.Add(23, "Pear", 17.32);
                dt.Rows.Add(27, "Banana", 12.20);
    
                GridView1.DataSource = dt;
                GridView1.DataBind();
            }
    
            protected void btnSubmit_Click(object sender, EventArgs e)
            {
                BindData();
            }
    

    There are so many different ways to go about what you are trying to do but the above will give you a quick introduction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After doing web development for quite a while, I am faced with a new
I am doing big project in Web Forms and entered a big mess of
I'm in an introductory comp-sci class (after doing web programming for years) and became
When doing some web maintenance today, I noticed a strange new folder on my
I created a new file-system based web site in Visual Studio 2010 . On property pages
The project is a default ASP.net Website built in vs 2010. I am new
I'm doing web project in tapestry by using jetty server in Eclipse. It works
I am doing a web project on media manager. I upload high resolution images
I've created a web application project in Visual Studio 2010 using Entity Framework Code
I'm doing a web project using jsp,mysql,ajax using netbeans and mysql. I'm having 3

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.