如何在app.config中添加connectionstring [英] How to add connectionstring in app.config

查看:109
本文介绍了如何在app.config中添加connectionstring的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<appSettings>
   <add key="dbVisitorManagement1" value="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dbVisitorManagement;Data Source=SHREE-PC"/>
 </appSettings>









这是我在app.confi中所做的g文件。但我得到一个错误,因为connectionString没有正确实现...



this is what I had done in my app.config file. but i had got an error as connectionString is not properly implemented...

推荐答案

configuration-connection-string-in-app-config-file-during-runt / [ ^ ]



使用connectionstring标签而不是appsettings
configuring-connection-string-in-app-config-file-during-runt/[^]

Use connectionstring tag instead of appsettings


将它放在ConnectionStrings而不是appSettings!
Put it in ConnectionStrings not appSettings!


<appSettings>
   <add key="dbVisitorManagement1" value="Provider=SQLOLEDB.1;Integrated Security=True;Persist Security Info=False;Database=dbVisitorManagement;Server=SHREE-PC"/>
 </appSettings>


这篇关于如何在app.config中添加connectionstring的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆