none
Timeout Expired.... RRS feed

  • Question

  • hi i'd created a system in my company and it works well but one of the PC got an error timeout expired.

     

    here's my code

    Dim conn as new sqlclient.sqlconnection("connectionstring")

    Dim com as new sqlclient.sqlcommand("Select * from table1",conn)

    com.connectiontimeout = 1000

    Dim ds as new dataset

    Dim da as new sqlclient.sqldataadapter(com)

    com.connection.open()

    da.fill(ds)

    com.connection.close()

     

    but still error occured

     

    i'd try to ping the server and it seem's well but when i try to type \\server into address bar of my computer... there's a difficulty to view the shared folder of the server..

    Tuesday, June 5, 2007 7:43 AM

All replies

  • First check the test connection to the Server. Validate your connection string. Problem may be in your permission to access the server.
    Tuesday, June 5, 2007 9:19 AM
  • we're on a same network and the server uses Windows Authentication which is Network Mgmt. Center all computers here are logged to network mgmt. center users. that's why i'm confusuing why this computer can't connect to the server.

     

    is my code ok? or there's something wrong in my code.

    Tuesday, June 5, 2007 9:33 AM
  • The last statement "well but when i try to type \\server into address bar of my computer... there's a difficulty to view the shared folder of the server" tells me there is access issues to the server. I would  verify that your account has the required access to the machine or else you might want to try using the sa username and password to connect to sql server. It could be that you might have to reboot the machine to get the new Security token before all users from the domain have access. Just a thought.
    Tuesday, June 5, 2007 11:12 PM
  • Does it timeout when code calls Open method of the connection or when code calls Fill method of the DataAdapter? If it is during Fill method, then timeout related to the command, not to the connection and increasing connection's timeout will not help. In that case you need to increase CommandTimeout property

    Wednesday, June 6, 2007 10:59 AM
    Moderator