简体   繁体   English

我无法在从IIS Windows 7运行的ASP.net网站上显示来自sql server 2005的数据

[英]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服务的服务器

Many more examples here. 这里有更多示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从ASP.NET 4.0中的SQL Server 2005检索数据 - Retrieve data from SQL Server 2005 in ASP.NET 4.0 无法从ASP.NET C#页连接到SQL Server 2005 Express - Can't connect to SQL Server 2005 Express from an ASP.NET C# page 从ASP.NET中的SQL Server通过单选按钮显示数据 - Display data in radio button from SQL Server in ASP.NET 我想根据用户ID将数据从SQL Server显示到ASP.NET文本框 - I want to display data from SQL Server to an ASP.NET textbox based on session of users id 将数据存储在sql server 2005 asp.net c#网站中 - store data in sql server 2005 asp.net c# website Windows Server 2016 上的 IIS 10 未运行我的 ASP.NET MVC 网站 - IIS 10 on Windows Server 2016 not running my ASP.NET MVC website 如何从在容器中运行的 ASP.NET 核心应用程序连接到具有集成安全性的 Windows 服务器上的 SQL 服务器 - How to connect from ASP.NET Core application running in a container to SQL Server on Windows Server with Integrated Security ASP.NET MVC:从 SQL 服务器快速移动到 Azure - ASP.NET MVC: moving from SQL Server Express to Azure ASP.NET 内核 Web 3.1 - IIS Express 可以从 localdb 获取数据,但本地 Z5DA5ACF461B4EFB27E6ZEC6 不能 - ASP.NET Core Web 3.1 - IIS Express can fetch data from localdb but local IIS can not ASP.NET MVC无法从本地SQL Server Express数据库检索数据 - ASP.NET MVC unable to retrieve data from local SQL Server Express database
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM