sql server connections via emulator... slooooow

  • Thread starter Thread starter mikeb
  • Start date Start date
M

mikeb

I am connecting to a sql server via my app. When its running on the device
the connection is instantanious. But when trying to connect from the
emulator it can take 10 minutes or more. The sooner I try to reconnect, the
fast it is though. But if I wait a longer amount of time between
connections (like if I have to actually make some code changes) its back to
10 minutes or more.

I've even tried adding "connect timeout = 5" to the conn str - but
regardless, it takes a long time.

Sometimes, rare, it connects quickly. This happens on more than just my
computer.

Ideas??
 
Gee, thanks -again- Chris....

Its a question, not a complaint.

I'm curious why this might be - a curiosity to see if there's something I
can do differently to make it faster.

I'm holding back...
 
Well, network transport is going to be slower than with a real network
connection, in both directions, so I'd suspect that. That's particularly
true if you're doing lots of transactions with relatively small bits of
stuff going back and forth. At a guess, I'd say that locating the server is
taking the time. How are you specifying the SQL Server machine? Name? IP
address? If name, you might try IP and see if that helps.

The emulator just isn't a high-performance alternative to the device...

Paul T.
 
Are you using an IP or a domain name for the server. The emulator doesn't
get full networking and name resolution can be a problem so that might be
it. The emulator is also succeptible to personal firewall issues so that
might be it. If there is a problem with the host PC's NIC, then the emulator
has problems so that might be it. The emulator is also notoriously
tempermental and sometimes it just doesn't work right until the system is
rebooted or the SDK reinstalled, so that might be it. The solution to
apparent hardware issues with the emulator is always the same - don't use
the emulator - and it's often faster to just use hardware than burn a day
trying to figure out why the emulator won't properly emulate.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 
Thanks Guys. I've tried the IP before with no luck - but this time used
the ip addresses associated with the loopback adapter (for dev my sqlserver
is hosted on my own development pc) and it worked. It seems much quicker to
find the server now. Thanks - the development cycle just got ton's faster!

So, if I have the loopback adapter connected, and also a wired or wireless
network connection, it appears that the emulator will choose the loopback
adapter over the other connections? Just a curiousity how this works.

I'm not usually able to use the hardware over the emulator, as the hardware
itself is usually at the customer site.

Thanks again.
 
It will choose the 'best' route. I don't think that it will ever prefer the
loopback adapter, unless you specify its IP address, to which the loopback
adapter is obviously the quickest way. If your wireless and wired Ethernet
both are on the same subnet, it will prefer the wired, if it's 100BaseT,
because that's faster. If you have Ethernet, wireless, and a dial-up
connection, all with IPs on the same subnet, it will choose Ethernet, as the
fastest. If they are all on different subnets, it will choose the one on
the same subnet as the target address, if there is one, and Ethernet
otherwise.

You need a copy of the hardware. The emulator is *not* a suitable test
platform.

Paul T.
 
Back
Top