[英]I cannot display data from sql server 2005 express on an ASP.net website running from IIS windows 7
I am using Microsoft server 2003 running sql server 2005 which I have added an asp.net website on IIs.This works perfect. 我正在使用运行sql server 2005的Microsoft server 2003,并在IIs上添加了一个asp.net网站。 I can display the website on the browser and also read information from the sql server. 我可以在浏览器上显示网站,也可以从sql服务器读取信息。 My problem now arises when I want to do exactly the same but with my laptop which is running sql server 2005 express on windows 7. the websites displays just fine on the localhost but when I login it gives me an error saying that it cannot read files. 现在,当我想做完全一样的事情但我的笔记本在Windows 7上运行sql server 2005 express时,就会出现我的问题。网站在localhost上显示得很好,但是当我登录时却出现错误,提示它无法读取文件。 So my question is that is there a difference between sql server connectionstring and sql server express connection string? 所以我的问题是sql server connectionstring和sql server express连接字符串之间有区别吗? or the error is not connectionstring related? 还是错误与connectionstring不相关?
Yes, the connection string for SQL Server CE is typically different from SQL Server. 是的,SQL Server CE的连接字符串通常不同于SQL Server。 SQL Server CE is "self hosted." SQL Server CE是“自托管的”。 You basically connect to a file in your app_data
directory. 您基本上可以连接到app_data
目录中的文件。 SQL Server, in contrast, has many ways to connect to it: via TCP/IP, Named Pipes, etc. 相比之下,SQL Server有很多连接方法:通过TCP / IP,命名管道等。
A typical SQL Server connection string is this: 典型的SQL Server连接字符串是这样的:
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
A typical SQL Server CE connection string is this: 典型的SQL Server CE连接字符串是这样的:
Data Source=MyData.sdf;Persist Security Info=False;
Notice how for SQL Server CE you specify the path to your database file. 请注意,对于SQL Server CE,如何指定数据库文件的路径。 For SQL Server, you typically specify the server running the SQL Server Service. 对于SQL Server,你通常会指定运行SQL Server服务的服务器 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.