Server Error in 'Performance' Application.
ExecuteReader: Connection property has not been initialized.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ExecuteReader: Connection property has not been initialized.
Function FncReadQuery(ByVal StrSql As String, ByVal DT As String) As OleDb.OleDbCommand
Dim ConnNewClient As New OleDb.OleDbConnection()
Dim commNewClient As New OleDb.OleDbCommand
Dim DbPath As String = FncGetPath()
ConnNewClient = New OleDbConnection
ConnNewClient = FncDBConnect(DbPath)
commNewClient = New OleDbCommand
commNewClient.CommandTimeout = 3600
commNewClient.Connection = ConnNewClient
commNewClient.CommandText = StrSql
With commNewClient.ExecuteReader
If .HasRows Then
ConnNewClient.Close()
Return commNewClient
Else
commNewClient = Nothing
Return Nothing
End If
End With
ConnNewClient.Close()
ConnNewClient = Nothing
commNewClient = Nothing
End Function