Click here to Skip to main content
15,896,522 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
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?

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?
 
Share this answer
 
Comments
saifullahiit 15-Jul-11 12:29pm    
i want to get this information from database and i am using asp.net with c#
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:

SQL
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
 
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