I need to create a public string function in c# that returns the result of a query in a string, so far I have this:
DBConnection connection = new DBConnection();
DBDataReader reader = new DBDataReader();
Reader.SelectCommand = new DBCommand("select count (*) from courses where CTP_ID = 'Biannual Update Courses'", connection);
DBDataReader reader = DBCommand.ExecuteReader(CommandBehavior.CloseConnection);
modules = result of query; ????
modules = ex.Message;
I know this code is wrong...can somebody show me where im going wrong or give me an alternative...many thanks in advance.
btw the query returns a single number as a result.