由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
DotNet版 - Problem connecting to SQL Server
相关主题
asp.net问题急问(初级)ASP.NET host server
WebSocket问题 (转载)ASP.Net比ASP倒底好多少?
ASPNET 访问SQL Server 2005 被拒[转载] sql server
[合集] ASPNET 访问SQL Server 2005 被拒foxpro and c#
pass request to other serverSQL Server2005的问题
超级脑残的Windows Remote WMI Access authenticationReason that hold me from upgrating to vs2008
Directory.GetFiles() is not working on client computerSSIS --- SQL Server 2005
Interview: small business of .netrsArray 为啥写不全?
相关话题的讨论汇总
话题: sql话题: server话题: problem话题: source
进入DotNet版参与讨论
1 (共1页)
y********o
发帖数: 2565
1
我用这个connection string, 不能从我的web application连到SQL Server.
"Data Source=localhost;Initial Catalog=MyWebAPPdb; User Id=usrnm; Password=w
odemima;";
但是可以用usrnm和wodemima从Management Studio用SQL Server Authentication模式成
功登录并浏览MyWebAPPdb数据库的表格,以及做其他操作。
我已经启用了SQL Server Authentication和Windows Authentication两种模式了,缘何
从web application里面还是不能连接成功?
N********n
发帖数: 8363
2

What's the name of your sql server? Put it in the above data source
and remove that 'localhost'.

【在 y********o 的大作中提到】
: 我用这个connection string, 不能从我的web application连到SQL Server.
: "Data Source=localhost;Initial Catalog=MyWebAPPdb; User Id=usrnm; Password=w
: odemima;";
: 但是可以用usrnm和wodemima从Management Studio用SQL Server Authentication模式成
: 功登录并浏览MyWebAPPdb数据库的表格,以及做其他操作。
: 我已经启用了SQL Server Authentication和Windows Authentication两种模式了,缘何
: 从web application里面还是不能连接成功?

y********o
发帖数: 2565
3
是不是这个:
MyComputerName\SQLSERVER2005 (SQL Server 9.0.1406)
?

【在 N********n 的大作中提到】
:
: What's the name of your sql server? Put it in the above data source
: and remove that 'localhost'.

N********n
发帖数: 8363
4
I think just your computer name, it's on the 1433 port right?

【在 y********o 的大作中提到】
: 是不是这个:
: MyComputerName\SQLSERVER2005 (SQL Server 9.0.1406)
: ?

y********o
发帖数: 2565
5
Isn't it 445?

【在 N********n 的大作中提到】
: I think just your computer name, it's on the 1433 port right?
N********n
发帖数: 8363
6
I don't know about express. Standard sql server is default on 1433.
If yours is on 445, then make "mycomputername,445" your data source.

【在 y********o 的大作中提到】
: Isn't it 445?
y********o
发帖数: 2565
7
我用了我的电脑名字加SQL Server名字,现在症状不一样了。瞧:
An error has occurred while establishing a connection to the server. When c
onnecting to SQL Server 2005, this failure may be caused by the fact that un
der the default settings SQL Server does not allow remote connections. (prov
ider: Named Pipes Provider, error: 40 - Could not open a connection to SQL S
erver)
哦,yes, mine is express. 那我干脆从在防火墙上将1433洞口也凿开试试。

【在 N********n 的大作中提到】
: I don't know about express. Standard sql server is default on 1433.
: If yours is on 445, then make "mycomputername,445" your data source.

N********n
发帖数: 8363
8
Just use your computer name without the sql server name. Do it in
this format "yourComputerName,port_number".

c
un
prov
S

【在 y********o 的大作中提到】
: 我用了我的电脑名字加SQL Server名字,现在症状不一样了。瞧:
: An error has occurred while establishing a connection to the server. When c
: onnecting to SQL Server 2005, this failure may be caused by the fact that un
: der the default settings SQL Server does not allow remote connections. (prov
: ider: Named Pipes Provider, error: 40 - Could not open a connection to SQL S
: erver)
: 哦,yes, mine is express. 那我干脆从在防火墙上将1433洞口也凿开试试。

N********n
发帖数: 8363
9

Since 127.0.0.1 is the address for localhost, you can use
"127.0.0.1, [sql_server_port]" as the data source. Sql server
configuration manager shows the port your server uses.

【在 N********n 的大作中提到】
: Just use your computer name without the sql server name. Do it in
: this format "yourComputerName,port_number".
:
: c
: un
: prov
: S

y********o
发帖数: 2565
10
刚试了一下,不行,明天再做。先行谢过了。

【在 N********n 的大作中提到】
: Just use your computer name without the sql server name. Do it in
: this format "yourComputerName,port_number".
:
: c
: un
: prov
: S

c**e
发帖数: 2558
11
by default, sql express is installed as a named instance.
in this case, the correct syntax for specifying Data Source is
either
localhost\sqlexpress
or
.\sqlexpress
you shouldn't need to specify a port number.

c
un
prov
S

【在 y********o 的大作中提到】
: 我用了我的电脑名字加SQL Server名字,现在症状不一样了。瞧:
: An error has occurred while establishing a connection to the server. When c
: onnecting to SQL Server 2005, this failure may be caused by the fact that un
: der the default settings SQL Server does not allow remote connections. (prov
: ider: Named Pipes Provider, error: 40 - Could not open a connection to SQL S
: erver)
: 哦,yes, mine is express. 那我干脆从在防火墙上将1433洞口也凿开试试。

y********o
发帖数: 2565
12
楼上两位兄台,多谢了。
我在用.NetTiers生成的code template, 是从公司的工作站上做的,需要在web.config
里面将有关.nettiers的connection string 也一并修改方可。
是我疏忽了,今日一觉醒来方意识到此问题。如此疏忽大意,再再不可饶恕。

【在 c**e 的大作中提到】
: by default, sql express is installed as a named instance.
: in this case, the correct syntax for specifying Data Source is
: either
: localhost\sqlexpress
: or
: .\sqlexpress
: you shouldn't need to specify a port number.
:
: c
: un

1 (共1页)
进入DotNet版参与讨论
相关主题
rsArray 为啥写不全?pass request to other server
用.NET做了个网站,大家来拍砖吧超级脑残的Windows Remote WMI Access authentication
如何积累.net开发的工作经验 (转载)Directory.GetFiles() is not working on client computer
【CINASSUG】【CINAOUG】SQL Server User Group 今晚讲座 07/17 (转载)Interview: small business of .net
asp.net问题急问(初级)ASP.NET host server
WebSocket问题 (转载)ASP.Net比ASP倒底好多少?
ASPNET 访问SQL Server 2005 被拒[转载] sql server
[合集] ASPNET 访问SQL Server 2005 被拒foxpro and c#
相关话题的讨论汇总
话题: sql话题: server话题: problem话题: source