• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

class library - connection string with typed datasets

I have a class library project and I've added a typed dataset to the project.  After compiling, everything ran fine in my development environment, but when I moved the assembly to my test server, which is using a different sql server, the connection didn't work.

I discovered that the connection string is hard-coded into the settings file in the class library project.  Thereby, I had to modify the connection string, recompile, deploy.  Then back in my development environment, I  had to reset the connection string for my development sql server, recompile and add the reference to my development  project again.

Please tell me there is an easier way to handle this?  If I have to make changes or add new typed datasets, I'd have to do the same over again.

Is there a way to overcome this?

Thanks for any help.
  • 2
1 Solution
Is your connectionstring stored into the code or is it stored in a settings.settings, app.config, ... ?
Perhaps this article can help you further
How to move a Typed Dataset to its own Project and Namespace - Part 2 - Deployment and ConnectionStrings

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now