Posted on: 8/26/2013 10:08:36 PM | Views : 717

When I call my function the first time, it is fine.  When I call it the second time, it fails with this error:
The ConnectionString property has not been initialized.
I'm trying to take the code at http://msdn.microsoft.com/en-us/library/haa3afyz.aspx and make it more generic so that I can pass any SQL string, any column name and any connection and get the resultant 'single' value for that column.  I would think that after this executes the first time, the connection and reader are closed and if I call back the second time it should be like new but apparently that is not the case and I don't understand why.
Private Function DBLookUp(ByVal connection As SqlConnection, ByVal SQLStr As String, ByVal VarReturn As String) As String 'Prototype 'SQLStr= "SELECT Category ...

Go to the complete details ...