Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. time ou error

time ou error

Scheduled Pinned Locked Moved .NET (Core and Framework)
sysadminhelp
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kulandaivel_mca2007
    wrote on last edited by
    #1

    Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. when i try to read large amount of data from online and add it to my combo box this error occurs what can i do... send me suggesstions...

    L 1 Reply Last reply
    0
    • K kulandaivel_mca2007

      Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. when i try to read large amount of data from online and add it to my combo box this error occurs what can i do... send me suggesstions...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Hi, Is this exception raised when you tried to fetch data from database server,then set the Connection Time out property to 0 (infinite). Tarun Singh

      K 1 Reply Last reply
      0
      • L Lost User

        Hi, Is this exception raised when you tried to fetch data from database server,then set the Connection Time out property to 0 (infinite). Tarun Singh

        K Offline
        K Offline
        kulandaivel_mca2007
        wrote on last edited by
        #3

        public SqlConnection objCon = new SqlConnection("Data Source=VEESERV2;Initial Catalog=Inventory_VS;User ID=sa;Password=sa;Connect Timeout = 60"); is it right?

        C W 2 Replies Last reply
        0
        • K kulandaivel_mca2007

          public SqlConnection objCon = new SqlConnection("Data Source=VEESERV2;Initial Catalog=Inventory_VS;User ID=sa;Password=sa;Connect Timeout = 60"); is it right?

          C Offline
          C Offline
          Colin Angus Mackay
          wrote on last edited by
          #4

          kulandaivel_mca2007 wrote:

          User ID=sa

          Seriously - Never connect to your database as "sa" you've just punched a very large security hole in your application.

          kulandaivel_mca2007 wrote:

          Connect Timeout = 60

          This is the amount of time you are willing to wait for the connection to be established. It defaults to 15 seconds. Your error message suggests that you have already made the connection, you are just waiting for the results. You therefore need to set the CommandTimeout on the command object. It defaults to 30 seconds. I do not advise setting to 0 (infinite) as your program will hang until it has the result. If your query is taking so long, you should also look optimising it. It may be that your query or database are set up very inefficiently.

          * Developer Day Scotland 2 - Free community conference * The Blog of Colin Angus Mackay


          Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

          1 Reply Last reply
          0
          • K kulandaivel_mca2007

            public SqlConnection objCon = new SqlConnection("Data Source=VEESERV2;Initial Catalog=Inventory_VS;User ID=sa;Password=sa;Connect Timeout = 60"); is it right?

            W Offline
            W Offline
            Wendelius
            wrote on last edited by
            #5

            That means that you wait for the connection for 60 seconds max. As Colin pointed out there are several issues in your connection string. However, if you're executing a query, is it really a problem in geting the connection or is the problem occuring when executing the query (after a connection is made). If it's in the query, the connection timeout has nothing to do with the problem. In that case you should try to optimize the query itself.

            The need to optimize rises from a bad design.My articles[^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups