Dynamic Connection Strings for Strongly Typed DataSet in a Class Library using App.Config

Posted by Luc on Stack Overflow See other posts from Stack Overflow or by Luc
Published on 2009-03-30T04:07:46Z Indexed on 2010/06/17 16:33 UTC
Read the original article Hit count: 402

This is my first question on StackOverflow.com and I'm not sure if this is the correct way to do this. I found a similar question titled: Modifying the Data Source for the Strongly Typed Dataset Connection String. However, the answer provided is not working for me. I'm not able to comment on it because I don't have enough "reputation points" (again, I just signed up), and I didn't want to provide an "answer", because I don't know the correct answer.

My problem is that I need to be able to modify the connection string inside the generated myproject.dll.config file, but doing so has no effect for me at all. My library still uses the default connection string that was setup at design time. I've tried everything I know to try, but still no luck. I've tried working around the issue using multiple different approaches, but still the problem persists. I can't find any help on the internet with my specific problem either. It would be great if somebody could shed some light as to why my modified config file isn't being read.

Useful information:

  • I'm using a Strongly Typed DataSet
  • I don't know the actual connection string at design time.
  • The app.config doesn't allow me to specify a 'User' scoped connection string.
  • I'm tied to a class library (no Windows Forms)

Thank you for any help!

Luc

© Stack Overflow or respective owner

Related posts about connection-string

Related posts about app-config