Receiving a Function warning after converting VB.net for VS 2003 to VS 2005.

I am converting a project that I was working on in VS 2003 but after I converted this project to VS 2005 I get the following error:

"Function 'selAllOrgMembers' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used."

Here is the function.

    Public Function selAllOrgMembers() As SqlDataAdapter
        Try
            Dim cmdAllOrgMembers As New SqlCommand("selAllOrgMembers", objConn)
            cmdAllOrgMembers.CommandType = CommandType.StoredProcedure
            objConn.Open()
            cmdAllOrgMembers.ExecuteNonQuery()
            objConn.Close()
            selAllOrgMembers = New SqlDataAdapter(cmdAllOrgMembers)
        Catch ex As SqlException
            MsgBox(ex.Message)
        End Try
    End Function

When I run this it works fine.  I am just trying to eliminate all the warnings I have and clean up my code.

How would I fix this warning that I am getting?

Thanks
Richard ComitoDirector of ITAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Carl TawnSystems and Integration DeveloperCommented:
Presumably it is because you do not have a return statement for your Catch block. You may just want to return null either in the catch block or after it as a default.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Éric MoreauSenior .Net ConsultantCommented:
Hi GabicusC,

You may add "return nothing" before the "end try"  

Cheers!
Richard ComitoDirector of ITAuthor Commented:
Thanks carl_tawn and emoreau for your replys.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.