How to read Max value of column in SQL Server
-
HI, How should i handle max(particular column) of a table in SQL server. SqldataReader.executeReader() not handles it i suppose. can any one help
-
HI, How should i handle max(particular column) of a table in SQL server. SqldataReader.executeReader() not handles it i suppose. can any one help
If it is only one value you are fetching than you can use ExecuteScalar on the SqlCommand object. But I think ExecuteReader should also work.
-
HI, How should i handle max(particular column) of a table in SQL server. SqldataReader.executeReader() not handles it i suppose. can any one help
SELECT MAX(MyColumn) FROM MyTable
You can then useExecuteScalar()
to read the value. Current blacklist svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour