如何更改整个项目的ConnectionString?

编程入门 行业动态 更新时间:2024-10-19 07:34:44
本文介绍了如何更改整个项目的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?

本文发布于:2023-11-27 21:53:44,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639734.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何更改   项目   ConnectionString

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!