I'm not an expert in programming and like to challenge myself sometimes when I'm free at work, so as the title says, just using a simple for-loop to get the max value of a column without the use of "Max(...)", is that possible?
EDIT: Here's an example
string getMax()
{
SqlCommand com = new SqlCommand("Select Max(UnitPrice) From Products", con);
con.Open();
string mx = com.ExecuteScalar().ToString();
con.Close();
return mx;
}
I meant Max in the SQLCommand, sorry for the confusion.