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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:14:00+00:00 2026-06-18T15:14:00+00:00

i want to retrive min and max value from dataset and those values use

  • 0

i want to retrive min and max value from dataset and those values use in for loop for display title in panel

    String sql = "select  title, song_id from up_song where Song_type='Mp3 Tracks' ";
    SqlDataAdapter adpt = new SqlDataAdapter(sql, cn);
    DataSet ds = new DataSet();
    adpt.Fill(ds, "title");

so here i want to find min and max value of song id…
here m is max value and k min value i have no idea …that how i select k and m…?

        for (i = m; i >= k; --i)
        {
            try
            {
                hp[i] = new HyperLink();
                hp[i].ID = "hp" + i;
                hp[i].Text = ds.Tables["title"].Rows[i].ItemArray[0].ToString();
                hp[i].NavigateUrl = "Downloadpage.aspx";
                hp[i].ForeColor = System.Drawing.Color.White;
                Panel1.Controls.Add(hp[i]);
                Panel1.Controls.Add(new LiteralControl("<br>"));
                HttpCookie coo = new HttpCookie("song");
                coo["sogtit"] = ds.Tables["title"].Rows[i].ItemArray[0].ToString();
                Response.Cookies.Add(coo);
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
  • 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-18T15:14:01+00:00Added an answer on June 18, 2026 at 3:14 pm

    With using Linq extension methods:

    int minSongId = ds.Tables["title"].AsEnumerable()
                      .Min(r => r.Field<int>("song_id"));
    int maxSongId = ds.Tables["title"].AsEnumerable()
                      .Max(r => r.Field<int>("song_id"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string which contains many <xxx> values. I want to retrive the
I want to retrive files with extension of .jpg from directory in vc++ 08.
I want to start several threads, retrive data from net, perform some actions with
I have a HTML table as follows. I want retrieve row values from this
How do I retrieve the max and min values of an excel chart series
How can I use the indices returned from 'min' function in matlab to retrieve
im want to execute a php script every 10 min in order to retrive
Suppose I search for a query in Field A, and I want to retrive
I want to retrieve the value of a parameter on the requested JSP called
SELECT TOP (100) PERCENT dbo.EmployeeInfo.id, MIN(dbo.EmployeeInfo.EmpNo) AS EmpNo, SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken FROM dbo.EmployeeInfo LEFT

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.