Earning your it works on my machine certification

worksonmymachine_logo_small If you are keen on earning your “It works on my machine certification” I have a tip for you. When using SQL express to develop a starter kit for www.asp.net., ensure that you hard code your connection string to a value that is specific to your machine. For example instead of doing it correctly like this:

connectionString=”Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=|DataDirectory|GreatAppData.mdf;User Instance=True”

You should use one like this:

connectionString=”Data Source=.\SQLExpress;Integrated Security=true;AttachDBFileName=c:\users\bruce\projects\greatapp\data\GreatAppData.mdf;User Instance=True”

That way you can ensure that it won’t work for anyone that downloads the source code. Thanks again to Joseph for the certification.

Fundamentals General0 comments