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

  • Home
  • SEARCH
  • 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 3421554
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:07:00+00:00 2026-05-18T06:07:00+00:00

I am having problems in setting a up a latest news panel on my

  • 0

I am having problems in setting a up a latest news panel on my website.

Currently

public System.Data.SqlClient.SqlConnection Admin_conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectString"].ToString());
protected void Page_Load(object sender, EventArgs e)
{
    DataTable dt = News();
    if (dt.Rows.Count > 0) // Check if the DataTable returns any data from database
    {

        lbltest.Text = dt.Rows[0]["NewsTitle"].ToString();
        lblDate.Text = dt.Rows[0]["NewsDate"].ToString();
        lbldescription.Text = dt.Rows[0]["NewsDescription"].ToString();
    }
}


protected DataTable News()
{
    DataTable dt = new DataTable();
    SqlDataAdapter data = new SqlDataAdapter("SELECT NewsTitle, NewsDescription, NewsDate FROM News WHERE [NewsDate] < getdate()", Admin_conn);
    data.Fill(dt);
    return dt;

}

But the above code just display news of single row.. I want to display all the news on my website. Which control should I use to display all the records from the database in a proper order like news title, news description then the next news title and description…..

Is there any way to use ajax accordion so that all the news title will be displayed and when I click on the specific news title, the description of that news will be displayed.

Any suggestions or tutorial will be highly appreciated..

  • 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-18T06:07:00+00:00Added an answer on May 18, 2026 at 6:07 am

    I believe you are looking for the ListView Control.

    It will allow you to bind to the entire set of rows being returned from the database and provide a template for each item.

    You can also take a few minutes to watch this video tutorial from Microsoft:

    The ListView Control: The Official Microsoft ASP.NET Site

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

Sidebar

Related Questions

Im having problems building a query with the linq to sql data query expression
I am having problems manually looping through xml data that is received via an
Hey, I'm having problems compressing files with Ionic.zlib, I'm very new to C# so
I am having a problem setting the Authorize attribute Role value from a variable.
I am in the process of setting up CruiseControl.NET. The problem I am having
Im having problems displaying records to my view when passing viewdata to a user
I have recently started having problems with TortoiseCVS, or more specifically with plink, the
I'm having problems using textures that are larger than the OpenGL window or the
I'm having problems deciding on what is the best way is to handle and
I am having problems getting text within a table to appear centered in IE.

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.