0

I've this situation with a web application:

-I don't have the source code -We need to change the database server ASAP -In order for the application to work, we need to change the connection string or find a workaround for this

It's a .NET 1.1 application, and the connection string is into a .dll. ¿What options do I have? The last time we changed the server, we put everything in the same server(including the database server) and then we added the ip of the database server to the new server... but this is not possible now because the database server will be hosted in other place.

Is there some way to "emulate" the ip of the last server?

What else can I do?

2 Answers 2

2

Assuming the DLL is a .NET DLL too, I'd consider the following:

  • Run ildasm to disassemble the DLL into IL
  • Edit the IL to change the connection string
  • Run ilasm (a .NET 1.1 version!) to reassemble the IL into a DLL
  • Make it very, very clear to management that you're in an unsustainable situation. You really can't run a production web site in this sort of state.
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you very much for your reply, I'll try this when my manager gives priority to this again, and I'll let you know the results... now they've problems with the new hosting hehe
0

If the connection string is hardcoded into the .DLL, and if it uses a name to reference the server (not its IP), you might want to change the hosts file on the server running the web site if you have access, so it points to the new DB server instead. Another choice may be to using the alias feature of the SQL native client to redirect the connection to somewhere else. But if the connection string uses an IP address, I don't think those methods would work. Changing the local IP address of the web server might allow some other server to take its place instead, again, if you have that kind of access. Nothing is 100% reliable if you can't really change the connection string.

In the long run, I think the best chance is if you can try to disassemble the DLL and modify the connection string so that its read from some configuration file, instead of being hardcoded, then recompile and from then on modify the parameters from the config.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.