I have a trick for this situation I keep three connection strings in my web.config file. The first connection string is named app_name_local, the second is app_name_server and finally app_name_application. For example if you have an application Foo you would have Foo_local, Foo_server, and Foo_application. I make all connections in the application to the app_name_application string. This makes it simple to manage. You never have to make a change to the connection string name anywhere in the application. I also keep copies of the server string and the local string in the other connection strings. When I upload the web.config file to the server, the only change I need to make is to the application connection string by copying the string from the server cs to the application cs. This way, I can keep local data to code with and not affect real data on the server. I hope this helps. Tom
T
Tom Harper
@Tom Harper
Posts
-
Is connection string must be changed after deployment ??? -
Escaping Text in a GridView for SQLServer databasesI am trying to come up with a way to use Uri.EscapeDataString() and Uri.UnescapeDataString() in a templated GridView so I can put tags into text that is uploaded into a SQlServer table, so that the formatted text can be put into a label on a web form. By escaping the data, I do not want to have ValidateRequest="false" set on the page header. I am trying to keep sqlInjection attacks from possibly happening on a database editing form. My goal on this page is to drop one of the html editors onto the page to make the textbox become a word-like editor so the client can format data to be displayed on the website. Thanks for any suggestions Tom