0

I've setup my VM to mimic my DevServer. I've setup my Network Connections to read from my Loopback Adapter 1st, LAN 4th. But for some reason, when I create my connection string: "Provider=SQLOLEDB;Data Source=DevServer; Initial Catalog=myDB; User Id=xxx; Password=yyy" inside an .ASPX file, it ALWAYS reads from the LAN Dev Server, instead of the VM Dev Server.

I don't understand why that is?

It's very frustrating because I have to constantly remove my cat5e cable from the back of the Host computer to break the LAN connection, and then it will read from my VM. And then inevitably, I want to search something on the net, and voila, my connection is unplugged, and I have to plug it back in.

What can I do to change this?

For more information, see the picture below...

http://twitpic.com/4zfmj/full

UPDATE: If I ping "DevServer" from my command prompt, it resolves to "192.168.0.2", which is my VM loopback adapter. So it should work, but then when it goes to through IIS and .aspx, it sees the LAN DevServer. So, apparently something is causing IIS to not listen to the VM and listen to the LAN address instead.

3 Answers3

1

If they are both named "devserver" there is probably a hostname mix up. Try and add the virtual "devserver" to your host file. If it works then, then you have a DNS issue. It may be a result of the computer not being 'smart' enough to go where it should :)

RateControl
  • 1,207
  • 9
  • 20
0

Best practice is to use separate server names for your devserver and your vmdevserver. If only need a short-term redirect, then the hosts file solution may fit your need.

Either way having duplicate names on the network (domain?) will be problematic.

rbs

0

This looks to be a name resolution issue - You need to figure out whether the name is being resolved by netbios or hostname - see this article

Then you can add your servername to your hosts and or lmhost file. The side affect of this is that the name will always resolve to your local vm

So you either change your connection string or you have to change your host files

Separate names would seem like the obvious thing to do - that's why everyone else is using them :-P

CPU_BUSY
  • 2,322
  • 17
  • 17