Professional Web Applications Themes

Handling Connections in ASP.NET - ASP.NET General

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 ...

  1. #1

    Default Handling Connections in ASP.NET

    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
    yop Guest

  2. #2

    Default Handling Connections in ASP.NET

    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_OnStart 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
    >>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
    >>.
    >>
    >.
    >
    yop Guest

  3. #3

    Default Re: Handling Connections in ASP.NET. Please Clarify

    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_OnStart

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

    TIA
    E
    "Ravikanth[MVP]" <dvravikanthhotmail.com> wrote in message
    news:084d01c35daf$c439fb20$a501280aphx.gbl...
    > Hi
    >
    > You can open connection in Application_OnStart 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
    > >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
    > >.
    > >

    Eric Fortin Guest

  4. #4

    Default Re: Handling Connections in ASP.NET. Please Clarify

    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
    [url]http://www.takempis.com[/url]
    Complex things are made up of
    lots of simple things.

    "Eric Fortin" <emfortincomcast.net> wrote in message
    news:2UOYa.98094$YN5.69586sccrnsc01...
    > 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_OnStart
    >
    > Currently, I am opening and closing the connection as needed. It is/can
    be
    > inefficient at times.
    >
    > TIA
    > E
    > "Ravikanth[MVP]" <dvravikanthhotmail.com> wrote in message
    > news:084d01c35daf$c439fb20$a501280aphx.gbl...
    > > Hi
    > >
    > > You can open connection in Application_OnStart 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
    > > >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
    > > >.
    > > >
    >
    >

    Kevin Spencer Guest

  5. #5

    Default Re: Handling Connections in ASP.NET. Please Clarify

    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
    [url]http://www.takempis.com[/url]
    Complex things are made up of
    lots of simple things.

    "Eric Fortin" <emfortincomcast.net> wrote in message
    news:eyPYa.97940$o%2.43781sccrnsc02...
    > 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=OraOleDB.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" <kevintakempis.com> wrote in message
    > news:uJMYVIcXDHA.608TK2MSFTNGP12.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
    > > [url]http://www.takempis.com[/url]
    > > Complex things are made up of
    > > lots of simple things.
    > >
    > > "Eric Fortin" <emfortincomcast.net> wrote in message
    > > news:2UOYa.98094$YN5.69586sccrnsc01...
    > > > 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_OnStart
    > > >
    > > > Currently, I am opening and closing the connection as needed. It
    is/can
    > > be
    > > > inefficient at times.
    > > >
    > > > TIA
    > > > E
    > > > "Ravikanth[MVP]" <dvravikanthhotmail.com> wrote in message
    > > > news:084d01c35daf$c439fb20$a501280aphx.gbl...
    > > > > Hi
    > > > >
    > > > > You can open connection in Application_OnStart 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
    > > > > >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
    > > > > >.
    > > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Kevin Spencer Guest

Similar Threads

  1. Event Handling
    By John Bankhead in forum ASP.NET Building Controls
    Replies: 0
    Last Post: June 24th, 05:48 PM
  2. CF Error Handling
    By JakeFlynn in forum Macromedia ColdFusion
    Replies: 0
    Last Post: March 16th, 01:29 AM
  3. Exception Handling.
    By Rajeev Soni in forum ASP.NET General
    Replies: 2
    Last Post: July 18th, 05:46 PM
  4. Error handling in SQL
    By George Ter-Saakov in forum Microsoft SQL / MS SQL Server
    Replies: 1
    Last Post: July 7th, 05:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139