Beginner-- storing the max value from table and storing in a string

Dec 18 2010 12:16 PM
hi
I am new to C# programming,Kindly help me in the above issue.

how can i store the max value from tale to a label.


string s = "select max(id) from gen";

label.text = Convert.ToString(cmd.ExecuteScalar); 

I am getting the following error
1)The best overloaded method match for 'System.Convert.ToString(object)' has some invalid arguments

2)Argument '1': cannot convert from 'method group' to 'object'


Answers (1)