Click here to Skip to main content
14,355,324 members
Rate this:
Please Sign up or sign in to vote.
See more:
i have a columns in database named highest. i have 2 textboxes(max,min) and 2 button(max, min) in asp.net web page. i want that when i click on max button it takes the highest values from that column in database and show it in max text box. when i click on min button it takes the minimum value to that column and show it in min text box. remember i am using asp.net web page.please tell me the solution.also code if possible
Posted
Comments
R. Giskard Reventlov 15-Jul-11 9:57am
   
What have you attempted yourself?
[no name] 15-Jul-11 10:06am
   
have you made any attempt yourself?
Rate this:
Please Sign up or sign in to vote.

Solution 2

Hi,

First, please be more specific in what you actually using (language, DB). Also always state what you already tried by yourself, because codeproject.com is a supporting-platform and not a "others do my work"-platform.

Anyway, here are some starting points for you, how you could get the min / max values out of a SQL DB:

TSQL MAX Command: http://msdn.microsoft.com/en-us/library/ms187751.aspx[^]
TSQL MIN Command: http://msdn.microsoft.com/en-us/library/ms179916.aspx[^]

The SQL Query for getting a max / min value could look like this:

SELECT MAX(MyColumn1), MIN(MyColumn2)
FROM tbl_MyTable


If you do not know how to access a SQL DB using ASP.NET, you could start with something like this:
Using ADO.NET for beginners[^]

Hope this helps to solve your problem.

Happy coding and have a nice weekend,
Stops
   
v2
Rate this:
Please Sign up or sign in to vote.

Solution 1

Yeah, that's nice - you're coding an ASP.Net web page. But:

0) Do you want to get this info from the database, or from data you've already retrieved from the database?

1) What language are you using? C#, or VB?
   
Comments
saifullahiit 15-Jul-11 12:29pm
   
i want to get this information from database and i am using asp.net with c#

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100