If i am expecting a single result or single value from sqlserver database then what command should i follow sqlcommand.executereader(commandbehaviour.singleresult) or sqlcommand.executescalar() ?
satyanarayan sahoo
If you want single value as a return from the database then you should use sqlcommand.executescalar().
Execute Scalar is used to return a single value.
sqlcommand.executescalar()