Web配置中的连接字符串 [英] connection string in web config

查看:101
本文介绍了Web配置中的连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,所有

当我将连接字符串添加到web配置

有错误

当我添加语句时

connectionStrings

add name =CSconnectionString =server = 192.168.3.34; database = TMTDB; uid = sa; pwd = 123/

/ connectionStrings



你可以在添加这些语句后告诉我web配置

解决方案

这是一个例子和详情:



http://www.connectionstrings.com/Articles/Show/store-connection-string-in-web-config [ ^ ]


 < span class =code-keyword><   connectionStrings  >  
< add 名称 = ConnectionStringName connectionString = 数据源= DatabaseServer;初始目录= DatabaseName;用户ID = *****;密码= ***** providerName = System.Data.SqlClient / >
< / connectionStrings >


以下是连接字符串的基本设置。

但是你想要哪个数据库要连接,它对acess / excel有一些更改

 <   connectionStrings  >  
< add name = hhcsnot connectionString = Server = database_server_ip; Initial Catalog = databasename; User ID = username;密码=你的密码 / >
< / connectionStrings >





或者你可以jus在visual studio中从服务器资源管理器拖放一个表(在这里用studio连接你的数据库),它为你自动创建一个连接字符串...



谢谢

asp.net中的数据库连接字符串 [ ^


hello to all
when i add the connection string to web config
have error
when i add the statements
connectionStrings
add name="CS" connectionString="server=192.168.3.34;database=TMTDB;uid=sa;pwd=123"/
/connectionStrings

and can you show me the web config after add this statements

解决方案

Here is the example and details:

http://www.connectionstrings.com/Articles/Show/store-connection-string-in-web-config[^]


<connectionStrings>
  <add name="ConnectionStringName" connectionString="Data Source=DatabaseServer;Initial Catalog=DatabaseName;User ID=*****;Password=*****" providerName="System.Data.SqlClient"/>
</connectionStrings>


Below is the basic setting for connection string.
But which database you want to connect, it have some changes for acess/excel

<connectionStrings>
<add name="hhcsnot"  connectionString="Server=database_server_ip;Initial Catalog=databasename;User ID=username;Password=yourpassword"/>
</connectionStrings>



or you can just drag and drop a table from server explorer(connect your database here with studio) in visual studio, It creates automatic a connection string for you...

Thanks
Database Connection String in asp.net[^]


这篇关于Web配置中的连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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