Newbie, connection timing out problem

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default Newbie, connection timing out problem

    Hi, sorry if this seems stupid :(


    I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the problem is the
    my pages are timing randomly, I use a ODBC connection to the database in
    the global.asa file (below), the problem is that my pages some times work
    right and some times they time out, but it is sporadically, can anybody help
    me?

    <SCRIPT LANGUAGE=VBScript RUNAT=Server>

    'EventName Description
    'Session_OnStart Runs the first time a user runs any page in your
    application
    'Session_OnEnd Runs when a user's session times out or quits your
    application
    'Application_OnStart Runs once when the first page of your application is
    run for the first time by any user
    'Application_OnEnd Runs once when the web server shuts down

    Sub Application_OnStart
    Application("strConnectString") =
    "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    End Sub

    </SCRIPT>

    And do my work on the database using ADO.net to execute some stored
    procedures in my database with the following code:

    dim strQuery
    dim dateRS
    dim objConn, Cmd

    set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionTimeout = 0
    objConn.Open Application("strConnectString")
    strQuery = "TimeFrame"
    Set dateRS = objConn.Execute(strQuery)



    Regards


    verci Guest

  2. Similar Questions and Discussions

    1. Newbie Question- Database connection
      I have been reading through the supplied manuals and actionscripting books and have yet to come across any information on how to connect to a...
    2. Connection timing out
      Is there any movement on this? I've noticed this problem the last couple of weeks too. I'll leave my development box sitting there for a random...
    3. Timing Duration of Database Connection
      Is there a way to time how long you stay connected to a particular data base?
    4. newbie connection / setup problems with MySql
      Hello. I'm a newbie to MySQL and just needs little help with a couple of problems. I am currently working through a book on Dreamweaver MX...
    5. HELP! Problem w/Flash MX sound timing
      I'm at the end of my rope with this problem. I'm building a movie in Flash MX (Mac G4, OS 9.2), and I can't seem to resolve a timing problem with...
  3. #2

    Default Re: Newbie, connection timing out problem

    > I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the problem is the
    > my pages are timing randomly, I use a ODBC connection to the database in
    > the global.asa file (below), the problem is that my pages some times work
    Remove your connection string from the global.asa file (which doesn't
    actually exist in .NET, did you mean asax or are you actually trying to
    convert an application from ASP to ASP.NET?
    > "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    Instead, put it in a class or module:

    public class Settings
    public readonly property ConnectionString as string
    get
    return "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    end get
    end property
    end class
    > And do my work on the database using ADO.net to execute some stored
    > procedures in my database with the following code:
    > dim strQuery
    > dim dateRS
    > dim objConn, Cmd
    >
    > set objConn = Server.CreateObject("ADODB.Connection")
    > objConn.ConnectionTimeout = 0
    > objConn.Open Application("strConnectString")
    > strQuery = "TimeFrame"
    > Set dateRS = objConn.Execute(strQuery)
    This looks more like old ADO, not ADO.NET.
    You need to use the System.Data.SqlClient namespace instead.
    And you need to fill a dataset, not an ado recordset.

    There's too much to answer here for you. I think you need to do some of
    the MSDN walkthroughs on using ADO.NET. Here's some classes to get you
    started:
    System.Data.Dataset
    System.Data.DataTable
    System.Data.SqlClient.SqlCommand
    System.Data.SqlClient.SqlDataAdapter
    System.Data.SqlClient.SqlConnection

    Steven

    Steven Nagy Guest

  4. #3

    Default Re: Newbie, connection timing out problem

    Hi

    Yes is old ADO, the company I work for has an old or original ASP system
    that needs maintenance and god only knows who was the original programmer,
    maybe in the near future I can fight to covert the whole app to asp.net,
    sorry about that snafu regardig asp.net 1.1 my bad!, ok now that we got
    things clear, regarding the time out issues that we are experiencing what
    are your thoughts? I need to stick to the actual programming style (for now)


    "Steven Nagy" <learndotnet@hotmail.com> wrote in message
    news:1161064097.695285.276280@k70g2000cwa.googlegr oups.com...
    >
    >> I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the problem is
    >> the
    >> my pages are timing randomly, I use a ODBC connection to the database
    >> in
    >> the global.asa file (below), the problem is that my pages some times work
    >
    > Remove your connection string from the global.asa file (which doesn't
    > actually exist in .NET, did you mean asax or are you actually trying to
    > convert an application from ASP to ASP.NET?
    >
    >> "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    >
    > Instead, put it in a class or module:
    >
    > public class Settings
    > public readonly property ConnectionString as string
    > get
    > return "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    > end get
    > end property
    > end class
    >
    >> And do my work on the database using ADO.net to execute some stored
    >> procedures in my database with the following code:
    >> dim strQuery
    >> dim dateRS
    >> dim objConn, Cmd
    >>
    >> set objConn = Server.CreateObject("ADODB.Connection")
    >> objConn.ConnectionTimeout = 0
    >> objConn.Open Application("strConnectString")
    >> strQuery = "TimeFrame"
    >> Set dateRS = objConn.Execute(strQuery)
    >
    > This looks more like old ADO, not ADO.NET.
    > You need to use the System.Data.SqlClient namespace instead.
    > And you need to fill a dataset, not an ado recordset.
    >
    > There's too much to answer here for you. I think you need to do some of
    > the MSDN walkthroughs on using ADO.NET. Here's some classes to get you
    > started:
    > System.Data.Dataset
    > System.Data.DataTable
    > System.Data.SqlClient.SqlCommand
    > System.Data.SqlClient.SqlDataAdapter
    > System.Data.SqlClient.SqlConnection
    >
    > Steven
    >

    verci Guest

  5. #4

    Default Re: Newbie, connection timing out problem

    Ok

    Well I don't actually remember any ASP or ADO. I haven't touched it for
    years.
    This news group is for asp.net. I am sure there is a relevant ASP group
    for you to post to.

    Best of luck,
    Steven

    verci wrote:
    > Hi
    >
    > Yes is old ADO, the company I work for has an old or original ASP system
    > that needs maintenance and god only knows who was the original programmer,
    > maybe in the near future I can fight to covert the whole app to asp.net,
    > sorry about that snafu regardig asp.net 1.1 my bad!, ok now that we got
    > things clear, regarding the time out issues that we are experiencing what
    > are your thoughts? I need to stick to the actual programming style (for now)
    >
    >
    > "Steven Nagy" <learndotnet@hotmail.com> wrote in message
    > news:1161064097.695285.276280@k70g2000cwa.googlegr oups.com...
    > >
    > >> I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the problem is
    > >> the
    > >> my pages are timing randomly, I use a ODBC connection to the database
    > >> in
    > >> the global.asa file (below), the problem is that my pages some times work
    > >
    > > Remove your connection string from the global.asa file (which doesn't
    > > actually exist in .NET, did you mean asax or are you actually trying to
    > > convert an application from ASP to ASP.NET?
    > >
    > >> "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    > >
    > > Instead, put it in a class or module:
    > >
    > > public class Settings
    > > public readonly property ConnectionString as string
    > > get
    > > return "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    > > end get
    > > end property
    > > end class
    > >
    > >> And do my work on the database using ADO.net to execute some stored
    > >> procedures in my database with the following code:
    > >> dim strQuery
    > >> dim dateRS
    > >> dim objConn, Cmd
    > >>
    > >> set objConn = Server.CreateObject("ADODB.Connection")
    > >> objConn.ConnectionTimeout = 0
    > >> objConn.Open Application("strConnectString")
    > >> strQuery = "TimeFrame"
    > >> Set dateRS = objConn.Execute(strQuery)
    > >
    > > This looks more like old ADO, not ADO.NET.
    > > You need to use the System.Data.SqlClient namespace instead.
    > > And you need to fill a dataset, not an ado recordset.
    > >
    > > There's too much to answer here for you. I think you need to do some of
    > > the MSDN walkthroughs on using ADO.NET. Here's some classes to get you
    > > started:
    > > System.Data.Dataset
    > > System.Data.DataTable
    > > System.Data.SqlClient.SqlCommand
    > > System.Data.SqlClient.SqlDataAdapter
    > > System.Data.SqlClient.SqlConnection
    > >
    > > Steven
    > >
    Steven Nagy Guest

  6. #5

    Default Re: Newbie, connection timing out problem

    Is TimeFrame an SP? You may want to see if you can optimize the stored
    procedure. In query analyzer you can "show execution plan" to see
    what's going on. If it happens sporadically there could be some
    locking going on.

    Also, set your command and recordset objects to nothing when you're
    done with them. It's possible that you're leaving the connections
    open, and the timeout is occuring because ADO is waiting for an
    available connection which never happens.

    Steven Nagy wrote:
    > Ok
    >
    > Well I don't actually remember any ASP or ADO. I haven't touched it for
    > years.
    > This news group is for asp.net. I am sure there is a relevant ASP group
    > for you to post to.
    >
    > Best of luck,
    > Steven
    >
    > verci wrote:
    > > Hi
    > >
    > > Yes is old ADO, the company I work for has an old or original ASP system
    > > that needs maintenance and god only knows who was the original programmer,
    > > maybe in the near future I can fight to covert the whole app to asp.net,
    > > sorry about that snafu regardig asp.net 1.1 my bad!, ok now that we got
    > > things clear, regarding the time out issues that we are experiencing what
    > > are your thoughts? I need to stick to the actual programming style (for now)
    > >
    > >
    > > "Steven Nagy" <learndotnet@hotmail.com> wrote in message
    > > news:1161064097.695285.276280@k70g2000cwa.googlegr oups.com...
    > > >
    > > >> I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the problem is
    > > >> the
    > > >> my pages are timing randomly, I use a ODBC connection to the database
    > > >> in
    > > >> the global.asa file (below), the problem is that my pages some times work
    > > >
    > > > Remove your connection string from the global.asa file (which doesn't
    > > > actually exist in .NET, did you mean asax or are you actually trying to
    > > > convert an application from ASP to ASP.NET?
    > > >
    > > >> "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    > > >
    > > > Instead, put it in a class or module:
    > > >
    > > > public class Settings
    > > > public readonly property ConnectionString as string
    > > > get
    > > > return "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    > > > end get
    > > > end property
    > > > end class
    > > >
    > > >> And do my work on the database using ADO.net to execute some stored
    > > >> procedures in my database with the following code:
    > > >> dim strQuery
    > > >> dim dateRS
    > > >> dim objConn, Cmd
    > > >>
    > > >> set objConn = Server.CreateObject("ADODB.Connection")
    > > >> objConn.ConnectionTimeout = 0
    > > >> objConn.Open Application("strConnectString")
    > > >> strQuery = "TimeFrame"
    > > >> Set dateRS = objConn.Execute(strQuery)
    > > >
    > > > This looks more like old ADO, not ADO.NET.
    > > > You need to use the System.Data.SqlClient namespace instead.
    > > > And you need to fill a dataset, not an ado recordset.
    > > >
    > > > There's too much to answer here for you. I think you need to do some of
    > > > the MSDN walkthroughs on using ADO.NET. Here's some classes to get you
    > > > started:
    > > > System.Data.Dataset
    > > > System.Data.DataTable
    > > > System.Data.SqlClient.SqlCommand
    > > > System.Data.SqlClient.SqlDataAdapter
    > > > System.Data.SqlClient.SqlConnection
    > > >
    > > > Steven
    > > >
    Michael Hamrah Guest

  7. #6

    Default Re: Newbie, connection timing out problem

    Hey, you were right, thanks!!!

    "Michael Hamrah" <mhamrah@gmail.com> wrote in message
    news:1161099346.084766.121080@e3g2000cwe.googlegro ups.com...
    > Is TimeFrame an SP? You may want to see if you can optimize the stored
    > procedure. In query analyzer you can "show execution plan" to see
    > what's going on. If it happens sporadically there could be some
    > locking going on.
    >
    > Also, set your command and recordset objects to nothing when you're
    > done with them. It's possible that you're leaving the connections
    > open, and the timeout is occuring because ADO is waiting for an
    > available connection which never happens.
    >
    > Steven Nagy wrote:
    >> Ok
    >>
    >> Well I don't actually remember any ASP or ADO. I haven't touched it for
    >> years.
    >> This news group is for asp.net. I am sure there is a relevant ASP group
    >> for you to post to.
    >>
    >> Best of luck,
    >> Steven
    >>
    >> verci wrote:
    >> > Hi
    >> >
    >> > Yes is old ADO, the company I work for has an old or original ASP
    >> > system
    >> > that needs maintenance and god only knows who was the original
    >> > programmer,
    >> > maybe in the near future I can fight to covert the whole app to
    >> > asp.net,
    >> > sorry about that snafu regardig asp.net 1.1 my bad!, ok now that we
    >> > got
    >> > things clear, regarding the time out issues that we are experiencing
    >> > what
    >> > are your thoughts? I need to stick to the actual programming style (for
    >> > now)
    >> >
    >> >
    >> > "Steven Nagy" <learndotnet@hotmail.com> wrote in message
    >> > news:1161064097.695285.276280@k70g2000cwa.googlegr oups.com...
    >> > >
    >> > >> I'm running WindowsXP, Asp.net 1.1 and Sql Server 2000 , the
    >> > >> problem is
    >> > >> the
    >> > >> my pages are timing randomly, I use a ODBC connection to the
    >> > >> database
    >> > >> in
    >> > >> the global.asa file (below), the problem is that my pages some times
    >> > >> work
    >> > >
    >> > > Remove your connection string from the global.asa file (which doesn't
    >> > > actually exist in .NET, did you mean asax or are you actually trying
    >> > > to
    >> > > convert an application from ASP to ASP.NET?
    >> > >
    >> > >> "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    >> > >
    >> > > Instead, put it in a class or module:
    >> > >
    >> > > public class Settings
    >> > > public readonly property ConnectionString as string
    >> > > get
    >> > > return "DSN=WorkDB;Database=EspecialDB;UID=sa;PWD=!*bman~ ;"
    >> > > end get
    >> > > end property
    >> > > end class
    >> > >
    >> > >> And do my work on the database using ADO.net to execute some stored
    >> > >> procedures in my database with the following code:
    >> > >> dim strQuery
    >> > >> dim dateRS
    >> > >> dim objConn, Cmd
    >> > >>
    >> > >> set objConn = Server.CreateObject("ADODB.Connection")
    >> > >> objConn.ConnectionTimeout = 0
    >> > >> objConn.Open Application("strConnectString")
    >> > >> strQuery = "TimeFrame"
    >> > >> Set dateRS = objConn.Execute(strQuery)
    >> > >
    >> > > This looks more like old ADO, not ADO.NET.
    >> > > You need to use the System.Data.SqlClient namespace instead.
    >> > > And you need to fill a dataset, not an ado recordset.
    >> > >
    >> > > There's too much to answer here for you. I think you need to do some
    >> > > of
    >> > > the MSDN walkthroughs on using ADO.NET. Here's some classes to get
    >> > > you
    >> > > started:
    >> > > System.Data.Dataset
    >> > > System.Data.DataTable
    >> > > System.Data.SqlClient.SqlCommand
    >> > > System.Data.SqlClient.SqlDataAdapter
    >> > > System.Data.SqlClient.SqlConnection
    >> > >
    >> > > Steven
    >> > >
    >

    verci Guest

Posting Permissions

  • You may not post new threads
  • You may 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