I have th following code:
public SqlConnection openConnection(string strConn)
{
try
{
SqlConnection conn = new SqlConnection();
conn.ConnectionString = Convert.ToString(strConn);
conn.Open();
return conn;
}
catch (Exception ex)
{
EventLog.WriteEntry(STR_LOG_SOURCE_NAME, "openConnection: " + ex.Message + " from source " + ex.Source, EventLogEntryType.Error);
}
}I got any error from the code, saying 'not all code path return a value', i suspect it is the catch block doesnt return a value. If so, what value should i return?
Thank You.
...
Go to the complete details ...