Microsoft
Software
Hardware
Network
Question : multiple connections per user
When displaying data on a web-page I open a new database connection each time I use it.
But this can result in many connections per page. Is there a way to open a connection at the beginning of the page and close it again when the page is finished?
or should I make 1 connection per session?
now I use:
Imports System.Data
Imports MySql.Data.MySqlClient
Dim connString As String = "server=localhost; user id=xxx; password=xxx; database=xxx; pooling=false;"
Dim con = New MySqlConnection(connString
)
con.Open()
Dim query As String = "query string here"
Dim ds = New DataSet()
Dim da = New MySqlDataAdapter(query, con)
da.Fill(ds)
//code here//
ds.Dispose()
da.Dispose()
con.Close()
con.Dispose()
Answer : multiple connections per user
There is a option called connection pooling, check this link
http://stackoverflow.c
om/questio
ns/1450984
/storing-d
atabase-
co
nnections-
in-session
-in-a-smal
l-scale-we
bapp
Random Solutions
How do I import a .jet database into access that has been locked?
SQL Server BIT field true and false
How do I move Windows to another drive or partition the one it is on is down to 5 Meg of free space.
Screen Scramble in Excel 2003
Slow Windows 2003 Print Server
How to specify an address on the From line in Sharepoint Designer email
Access 07 "encountered an error during setup" on a PC that has Office 07 standard already installed
ScaleMode in VBA
Do I have to select a predefined Identity field when using the SELECT INTO clause in a SQL Server stored procedure ?
Allow real desktop access to Windows Server 2008 R2