I new to working with VS2008. My company wants me to debug a program in VS2008 coded in Visual Basic. When I run the program in Debug mode I get the following warning messages below. I've been trying to fix them based on what I know from Visual Basic 6, but now I'm sure in regards to coding in Visual Basic in VS2008. How do I fix these issue, and why.
See below the warning messages, and see attached file for code.
Warning 1 - Function 'OraConnection' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Development\CPR_Env_Mai
ata Source\DBConnection.vb 61 5 CprApplicationInfo
Warning 2 - Function 'Connection' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used. C:\Development\CPR_Env_Mai
ata Source\DBConnection.vb 115 5 CprApplicationInfo
Public Shared Function OraConnection() As OracleClient.OracleConnection
CN = New OracleClient.OracleConnection
CN.ConnectionString = sConnBase 'cConnString_BASE
Catch Ex As Exception
MessageBox.Show("Application could not connect to the Database." & ControlChars.NewLine & ControlChars.NewLine & Ex.Message, "Connection to Database", MessageBoxButtons.OK, MessageBoxIcon.Stop, MessageBoxDefaultButton.Button1)
End Function <-- the error occurs here.