How to vary connection string for different work locations

后端 未结 7 2025
情话喂你
情话喂你 2021-02-10 15:55

I am working on a C# 4.0, WPF 4.0, SQL 2008 project and I do work at home and in the office. I just setup SubVersion using Visual SVN per the recommendations found in other ques

7条回答
  •  借酒劲吻你
    2021-02-10 16:27

    Can't you change the .config at home and not check the change to the connection string back in?

    Holding connection string information in code is bad practice (anyone can use ildasm.exe and see all the strings in your code).

    This kind of information should be in configuration which you have better control over.

    Additionally, .NET supports encryption of the connection string section, if needed.

提交回复
热议问题