A
Agnes
During form Load, I want to fill in the dataset and the close the connection
at once. However, In SQL Server, I still find that the connection exists and
the status is "AWAITING COMMAND". My client 's IT admin complaint that this
connection should be disappear.
I really got no idea about SQL admin Please help ~~
Try
dsGLJnHeader.Clear()
daGLJnHeader.SelectCommand = New SqlCommand
daGLJnHeader.TableMappings.Add("Table", "GLJnHeader")
daGLJnHeader.SelectCommand.CommandText = "select " &
strSQLData_H & " from GLJnHeader " & strSQLwhere & " ORDER BY voucherno desc
"
daGLJnHeader.SelectCommand.Connection =
dtsclass.DatabaseConnection.GetDbConnection("ACCOUNT")
daGLJnHeader.Fill(dsGLJnHeader, "GLJnHeader")
Catch err As Exception
MessageBox.Show(err.Message, "Form Load-Fille-GlJnHeader")
Finally
daGLJnHeader.close
end try
at once. However, In SQL Server, I still find that the connection exists and
the status is "AWAITING COMMAND". My client 's IT admin complaint that this
connection should be disappear.
I really got no idea about SQL admin Please help ~~
Try
dsGLJnHeader.Clear()
daGLJnHeader.SelectCommand = New SqlCommand
daGLJnHeader.TableMappings.Add("Table", "GLJnHeader")
daGLJnHeader.SelectCommand.CommandText = "select " &
strSQLData_H & " from GLJnHeader " & strSQLwhere & " ORDER BY voucherno desc
"
daGLJnHeader.SelectCommand.Connection =
dtsclass.DatabaseConnection.GetDbConnection("ACCOUNT")
daGLJnHeader.Fill(dsGLJnHeader, "GLJnHeader")
Catch err As Exception
MessageBox.Show(err.Message, "Form Load-Fille-GlJnHeader")
Finally
daGLJnHeader.close
end try