使用webconfig进行数据库连接 [英] db connection using webconfig

查看:71
本文介绍了使用webconfig进行数据库连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

db连接

推荐答案

这不是问题,也没有道理.您的web.config可以存储连接字符串,但事实是,它不会更改数据库连接代码.我建议,如果您认为这是一个值得提出的问题,那么您确实需要比在论坛中获得更多的帮助,尝试购买编程书籍或学习课程更多的帮助.
This is not a question, nor does it make sense. Your web.config can store a connection string, but the fact that it does, doesn''t change your DB connection code. I would suggest that if you thought this was a worthwhile thing to ask, then you really need a lot more help than you can get in a forum, try buying a programming book, or taking a course.


我同意这是一个懒惰的问题,无需付出太多努力.

不过,根据共享的内容(无论如何!),这应该有所帮助: web.config中的AppSettings [ ^ ]
I agree that this is lazy question asked without much of effort shown.

Still, based on the content (whatever!) shared, this should help: AppSettings In web.config [^]


您可以在Web中设置连接配置文件,

像下面的

You can set conncetion in Web config File,

like below

<connectionstrings>
		<add name="master" connectionstring="Data Source=10.101.65.178;Initial Catalog=master;User ID=sa;Password=xxxx" providername="System.Data.SqlClient" />
    
	</connectionstrings>


这篇关于使用webconfig进行数据库连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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