本文介绍了如何更改整个项目的ConnectionString?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在家中开发此应用程序但又能够在教室中部署它时,如何更改SQL ConnectionString?需要一个小的example.thanks
How do I change the SQL ConnectionString when I am developing this appliaction in my home and yet be able to deploy it at my class room ? need small example.thanks
推荐答案为此,您可以将connectionstring放在web.config文件中.您可以将连接字符串如下所示放在配置"部分下,然后在将应用程序移至教室时更改,只需更改web.config中的值即可. For this purpose you can put connectionstring in web.config file. you can put connection string as below under configurations section and ater when you move your application to class room just change value in web.config. <appsettings> <add key="constring" value="actual connectionstring" /> </appsettings>
更多推荐
如何更改整个项目的ConnectionString?
发布评论