HI,
I'm getting the object refernce not set to an instance of an object error in the code below.
I couldnt figure it out, where I'm going wrong.
Please help.
Public Function GetConnection() As SqlConnection
Dim connectionString As New SqlConnection()
Dim Conn As String = Nothing
Conn = ConfigurationManager.ConnectionStrings("connectionString").ConnectionString
Dim objConnection As New SqlConnection()
objConnection.ConnectionString = Conn
Return objConnection
End Function
The error is on the 4th line of the code.