Click here to Skip to main content
15,794,629 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a table column named myvalues, an asp.net webpage contains one button. i want when user click on button it takes the highest value from that myvalues column and show it on the page. how is it possible.?
Posted
Comments
Christoph Keller 16-Jul-11 13:47pm    
Why you don't look at the answers of your previous posted (same) question here: http://www.codeproject.com/Questions/226395/how-to-get-max-min-values-from-a-specific-col-in-d?

You need an SQL Command similar to:
SELECT MAX(myColumn) FROM myTable
 
Share this answer
 
Comments
Uday P.Singh 16-Jul-11 3:50am    
correct my 5!
SqlCommand cmd = new SqlCommand("select max(myColumn) as myColumnfrom myTable", con);
        con.Open();
        string  a =Convert.ToString( cmd.ExecuteScalar());
        
            Response.Write(a);

        con.Close();




use it
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900