dbTalk Databases Forums  

sql connection close problem (with vb.net lang)

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss sql connection close problem (with vb.net lang) in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Agnes
 
Posts: n/a

Default sql connection close problem (with vb.net lang) - 02-22-2007 , 08:32 PM






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("ACCOU NT")
daGLJnHeader.Fill(dsGLJnHeader, "GLJnHeader")

Catch err As Exception
MessageBox.Show(err.Message, "Form Load-Fille-GlJnHeader")
Finally
daGLJnHeader.close
end try



Reply With Quote
  #2  
Old   
Sue Hoegemeier
 
Posts: n/a

Default Re: sql connection close problem (with vb.net lang) - 02-25-2007 , 03:31 PM






You should first check if connection pooling/session pooling
is enabled. The client can also check if sp_reset_connection
is firing for these connection - that's used by connection
pooling.

-Sue

On Fri, 23 Feb 2007 10:32:30 +0800, "Agnes"
<agnes (AT) dynamictech (DOT) com.hk> wrote:

Quote:
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("ACCOU NT")
daGLJnHeader.Fill(dsGLJnHeader, "GLJnHeader")

Catch err As Exception
MessageBox.Show(err.Message, "Form Load-Fille-GlJnHeader")
Finally
daGLJnHeader.close
end try



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.