473,770 Members | 5,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Handling Connections in ASP.NET

yop
Lads

Am using ASP.NET, Framework 1.1
Creating a web application to read details from a MYSQL
database.
Am using the dbProvider to create connection to the DB.
I am having a lot of issues with connection pooling etc.
Also of late getting an error, "Could not initiate
communication with the server" which is strange.

How do you suggest I handle connections? At the moment I
create a new connection in each function in the .VB files
but these connections are been closed and destroyed as I
leave the function.

Is it possible to create a connection once and share it
across all pages/code files?

Thanks
Nov 17 '05 #1
4 1204
yop
Ravikanth

Thanks for that, I presume that this is in the session
object that I do that

Thanks

-----Original Message-----
Hi

You can open connection in Application_OnS tart and can beshared across all pages.

Ravikanth[MVP]

-----Original Message-----
Lads

Am using ASP.NET, Framework 1.1
Creating a web application to read details from a MYSQL
database.
Am using the dbProvider to create connection to the DB.
I am having a lot of issues with connection pooling etc.
Also of late getting an error, "Could not initiate
communicati on with the server" which is strange.

How do you suggest I handle connections? At the moment Icreate a new connection in each function in the .VB

files
but these connections are been closed and destroyed as Ileave the function.

Is it possible to create a connection once and share it
across all pages/code files?

Thanks
.

.

Nov 17 '05 #2
I have the same problem....

I have a web app (upgraded from a traditional client/server app) with a
dozen or so web forms that will be accessed by about a hundred users
(possibly at one time). The number of transactions may be relatively
extensive (no google, but 1000's of reads and writes to the db per day)

What is the preferred/suggested method for the database connection.

COnnection pooling?
Application_OnS tart

Currently, I am opening and closing the connection as needed. It is/can be
inefficient at times.

TIA
E
"Ravikanth[MVP]" <dv*********@ho tmail.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi

You can open connection in Application_OnS tart and can be
shared across all pages.

Ravikanth[MVP]

-----Original Message-----
Lads

Am using ASP.NET, Framework 1.1
Creating a web application to read details from a MYSQL
database.
Am using the dbProvider to create connection to the DB.
I am having a lot of issues with connection pooling etc.
Also of late getting an error, "Could not initiate
communicatio n with the server" which is strange.

How do you suggest I handle connections? At the moment I
create a new connection in each function in the .VB

files
but these connections are been closed and destroyed as I
leave the function.

Is it possible to create a connection once and share it
across all pages/code files?

Thanks
.

Nov 17 '05 #3
Connection Pooling is built into the .Net Framework. It is best to open and
close Connections as quickly as possible. Connection Pooling will take care
of the rest.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Eric Fortin" <em******@comca st.net> wrote in message
news:2UOYa.9809 4$YN5.69586@scc rnsc01...
I have the same problem....

I have a web app (upgraded from a traditional client/server app) with a
dozen or so web forms that will be accessed by about a hundred users
(possibly at one time). The number of transactions may be relatively
extensive (no google, but 1000's of reads and writes to the db per day)

What is the preferred/suggested method for the database connection.

COnnection pooling?
Application_OnS tart

Currently, I am opening and closing the connection as needed. It is/can be inefficient at times.

TIA
E
"Ravikanth[MVP]" <dv*********@ho tmail.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
Hi

You can open connection in Application_OnS tart and can be
shared across all pages.

Ravikanth[MVP]

-----Original Message-----
Lads

Am using ASP.NET, Framework 1.1
Creating a web application to read details from a MYSQL
database.
Am using the dbProvider to create connection to the DB.
I am having a lot of issues with connection pooling etc.
Also of late getting an error, "Could not initiate
communicatio n with the server" which is strange.

How do you suggest I handle connections? At the moment I
create a new connection in each function in the .VB

files
but these connections are been closed and destroyed as I
leave the function.

Is it possible to create a connection once and share it
across all pages/code files?

Thanks
.


Nov 17 '05 #4
As long as the Connection String is identical the Connection can be reused
from the Pool. You don't have to think about Connection Pooling otherwise,
as it is automatic.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Eric Fortin" <em******@comca st.net> wrote in message
news:eyPYa.9794 0$o%2.43781@scc rnsc02...
Thanks, Kevin. A couple questions then (Probably newbie related):

Note: It's an oracle database, so I'm using the OleDb.... with connection
string: Provider=OraOle DB.Oracle..."

Is there anything I have to do that I'm not doing... (I have not specified connection pooling or anything else...)

Right now, when I need to do database stuff, I create a connection, use the connection, close the connection. The oracle db user/password is always the same.

Am I set up right?
"Kevin Spencer" <ke***@takempis .com> wrote in message
news:uJ******** *****@TK2MSFTNG P12.phx.gbl...
Connection Pooling is built into the .Net Framework. It is best to open

and
close Connections as quickly as possible. Connection Pooling will take

care
of the rest.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Complex things are made up of
lots of simple things.

"Eric Fortin" <em******@comca st.net> wrote in message
news:2UOYa.9809 4$YN5.69586@scc rnsc01...
I have the same problem....

I have a web app (upgraded from a traditional client/server app) with a dozen or so web forms that will be accessed by about a hundred users
(possibly at one time). The number of transactions may be relatively
extensive (no google, but 1000's of reads and writes to the db per day)
What is the preferred/suggested method for the database connection.

COnnection pooling?
Application_OnS tart

Currently, I am opening and closing the connection as needed. It
is/can be
inefficient at times.

TIA
E
"Ravikanth[MVP]" <dv*********@ho tmail.com> wrote in message
news:08******** *************** *****@phx.gbl.. .
> Hi
>
> You can open connection in Application_OnS tart and can be
> shared across all pages.
>
> Ravikanth[MVP]
>
>
> >-----Original Message-----
> >Lads
> >
> >Am using ASP.NET, Framework 1.1
> >Creating a web application to read details from a MYSQL
> >database.
> >Am using the dbProvider to create connection to the DB.
> >I am having a lot of issues with connection pooling etc.
> >Also of late getting an error, "Could not initiate
> >communicatio n with the server" which is strange.
> >
> >How do you suggest I handle connections? At the moment I
> >create a new connection in each function in the .VB
> files
> >but these connections are been closed and destroyed as I
> >leave the function.
> >
> >Is it possible to create a connection once and share it
> >across all pages/code files?
> >
> >Thanks
> >.
> >



Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2711
by: Leif Wessman | last post by:
I have a php-webpage that needs the database in the beginning and in the end of the script. In the middle there is a lot of processing that takes several seconds - during that time I don't use the database connection. What is the best approach? Should I close the connection after I'm done with it OR should I reuse the connection thru my whole script? Where can I read more about this? Any pointers?
9
2481
by: Phil Jenson | last post by:
I am try to evaluate the most efficient method of handling thousands of simultaneous TCP connects each of which remain connected to the server for hours and pass a small amount of data usually once a minute. The data received is logged in a SQL Server database. The only method I have found of reading each socket requires a thread for each connection which blocks waiting for data. This appears to be very inefficient as it will result in...
4
7170
by: Edward Singleton | last post by:
I am currently developing a web app using WSAD 5.1 and DB2 V7.2.8. I understand there is a myriad of database errors related to obtaining valid connections that are mapped directly to com.ibm.websphere.ce.cm.StaleConnectionException. There are apparently two solutions to ensure a valid connection is obtained from a WebSphere dataSource. The first is to catch StaleConnectionExceptions and attempt to execute the transaction again a...
4
2859
by: Troy | last post by:
We recently installed the .Net framework on a windows 2000 server. Shortly after that we experienced intermitant problems running a web based program that accesses an Access 2002 database. The intranet .asp program works, but as soon as it tries to access the database for normal users, it gives us an "unspecified error" and that it can't access the data base. As the administrator, I found my access was relatively stable. Anyone else...
4
2002
by: Sandy | last post by:
Hello - I read an interesting article on the web wherein the author states he doesn't handle too many errors at page level, but handles them at the application level. He further goes on to show how error logging can be incorporated using a Sql Server log with an additional text log in case Sql Server was down. My inclination after reading the article is to use Try-Catch-Finally as little as possible (tends to slow things if you have...
2
1272
by: Susan Baker | last post by:
Hi, I am writing a Win32 DLL. I want to be able to handle any SEGVs (segmentation violations) gracefully, by using an error handler of sorts. Currently, if a user of my DLL (typically a VB programmer) passes a null (or invalid) pointer to my library - the entire application crashes, leaving shared memory, database connections etc in a "dirty" state. I would like a way of gracefully handling user "actions" like this - without crashing...
3
1719
by: Susan Baker | last post by:
Hi, I am writing a (unmanaged) Win32 DLL. I want to be able to handle any SEGVs (segmentation violations) gracefully, by using an error handler of sorts. Currently, if a user of my DLL (typically a VB programmer) passes a null (or invalid) pointer to my library - the entire application crashes, leaving shared memory, database connections etc in a "dirty" state. I would like a way of gracefully handling user "actions" like this -
2
1408
by: ===Steve L.=== | last post by:
does anyone know any site or ariticle provides exmaple for building a Global Error Handling Module in VB.Net? the module should be able to 1. prouduce friendly generic error msg for the users and gracefully exit the app. 2. capture vital error info for developers (such which application, where in the application, what type of error such as network, database connection, VB and so on, and error details) into a sql database for diagnosis. ...
5
2790
RamananKalirajan
by: RamananKalirajan | last post by:
Hi guys, I am having a problem in Prototypejs AJAX, I am triggering the AJAX call and in the option i am using like the folowing code: new Ajax.Request(connection.url, { method: (connection.method ? connection.method : 'post'), on404: function(request){ alert("File Not Found Exception Occured "); this.connections.waitPop(); this.isProcessing = false; this.processNext(); }.bind(this),
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5450
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3972
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.