March 27th, 2010, 06:17 AM
Join Date: Sep 2006
Time spent in forums: 16 h 25 m 19 sec
Reputation Power: 12
i am developing my first project in ASP.Net with database in Oracle. to connect with db, i have made connection file.
Public Class ConnectionOra
Dim ConnString As String = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOC OL=TCP)(HOST=IP)(PORT=POrt)))(CONNECT_DATA=(SERVER =DEDICATED)(SERVICE_NAME=XE)));uid=databasename;pw d=password;"
Dim strConn As String = "Data Source=(DESCRIPTION =(ADDRESS =(PROTOCOL = TCP)(HOST = IP)(PORT = port))(CONNECT_DATA = (SID = sid)));User Id=uid;Password=password;"
Dim conn As New OracleConnection(strConn)
If conn.State = Data.ConnectionState.Closed Then
i call the above function in each page where i have to display data from db.
Dim cn As New ConnectionOra
Dim cmd As New OracleCommand
cmd.Connection = cn.connectionOracle
cmd = "select query"
now the problem is, the conenction is called/opened every time the page loads. and the whole server hang. and it stop all other applications also. so this is the BIG issue.
please help me. it's a serious problem.