Solved

SQL connection very slow

Posted on 2009-04-09
11
506 Views
Last Modified: 2012-08-13
Hi, i am using vb.net08 with sql05. My SQL connection is very slow or it is timeingout, below is my connection code,
It runs fine on my local machine, however when i switch the server name in my connection string to my Dev server it times out or is very slow
thanks allot
Dim cn As SqlConnection
cn = New SqlConnection("server=fas_1;database=spsv2;MultipleActiveResultSets=True;uid=dev;pwd=ved;")
cn.Open()

Open in new window

0
Comment
Question by:CraigLazar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
11 Comments
 
LVL 3

Expert Comment

by:techmaza
ID: 24113638
 Check ur connection string properly and check if server is alive and listening at port 1443 (i guess u may set this port for sql server connection) on ur server side. Check whether at server side u r able to connect to server with given username and password and if all is Ok then we may have digg for possible solution.
  post comment on ur problem further.


ThankU
Amit Shukla
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 200 total points
ID: 24113713
how "slow"?

if it's like 30 seconds, you must check if the dns resolution for the server name is slow eventually.
-> try to use the server's IP address instead of the name and see if that helps. if it does, check with the fully qualified server name (fas_1.). disuss the results with your network administrator

if that does not help, it's either:
* the network itself being swamped with traffic -> to be discussed with the network admin
* the server being slow to respond, due to high traffic or general slowness -> check while logged in the server itself, if the machine is sluggish or not?

 
0
 
LVL 26

Assisted Solution

by:Anurag Thakur
Anurag Thakur earned 200 total points
ID: 24113723
what kind of timeout are you talking out
connection timeout - means that you are getting this error after 30 seconds while trying to connect to the sql server, if you set this value to 0 then its infinite (not recommended)

command timeout - means that the connection has been established but you query execution is talking longer than the default time or 30 seconds and timing out
you can set the command timeout to 0 means infinite by default its 30 seconds
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 15

Assisted Solution

by:oobayly
oobayly earned 100 total points
ID: 24114712
Does SQL Server on your development machine accept TCP connections? You may find that the service is listening only on Name Pipes & Shared Memory.
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24114744
the author is not using an ip to connect to the sql server machine so it does not matter if tcp is enabled or not
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24115136
@ragi0017
Oops, just finished working on a MySql system, and they use Server to specify the host.
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 24135076
Hi Guys,
thanks for the input, i am going on site today so i will let you know
thanks
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 24137463
Hi,
Ok today it has not timed out today and i changed the server name to its IP address and still quite slow
I am connecting to a dev server and tested the connection speed and its averaged to 6 seconds
 
thanks
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24138077
if you used the ip address, and it's still slow, then it's not the dns server resolution.

please check the server itself, how is it's memory and cpu utilization?
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24146151
are the machines on the same subnet
are the machines on the same LAN
0
 
LVL 4

Author Comment

by:CraigLazar
ID: 24146365
Hi,
@ragi0017 - as far as i know they r on the same lan and sub net mask. I am on site so i will have to confirm that with the System Aministrator - they have plugged my notebook onto the domain, however i am not logging onto the Active directory as an autehnticated user, could that perhaps be the problem?
 
thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how the fundamental information of how to create a table.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question