如何在IIS中执行ASP.NET项目 [英] How to execute ASP.NET project in IIS

查看:63
本文介绍了如何在IIS中执行ASP.NET项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,我在Asp.net(VS 2008)中使用C#开发了一个简单的邮件应用程序,并使用ODBC与Sql Server 2005进行了数据库连接.

实际上,我在文件系统中开发了整个项目.该应用程序在VS中运行出色,现在我想在IIS 5.0中运行该应用程序.

我也右键单击解决方案资源管理器并发布,但是找不到"cs"文件,并且无法连接数据库.

请告诉我如何在IIS中运行该应用程序.我的系统中有IIS 5.0.

这是我的连接字符串

Hello Friends I developed a simple mail application in Asp.net(VS 2008) using C# and Database connectivity using ODBC with Sql Server 2005.

Actually i developed the entire project in file system. The application run excellent in VS now I want to run the application in IIS 5.0.

I also right click solution explorer and published but I cannot find "cs" files and I was unable to connect with database.

Please tell me how to run the application in IIS. I have IIS 5.0 in my system.

Here is my connection string

<connectionStrings>
 <add name="BuiltTech" connectionString="Dsn=built;app=Microsoft® Visual Studio® 2008;wsid=PRASHANTH;database=BuiltMaster;network=DBMSSOCN;trusted_connection=no;user=<windows_login_username>;password=<windows_login_password>"

  providerName="System.Data.Odbc" />
</connectionStrings>



这是我的错误

``/builttech''应用程序中的服务器错误.
错误[IM002] [Microsoft] [ODBC驱动程序管理器]找不到数据源名称,并且未指定默认驱动程序

在此先感谢



This is my Error

Server Error in ''/builttech'' Application.
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Thanks in Advance

推荐答案

您是否收到有关连接的任何错误消息.由于您使用的是可信连接,因此应该定义运行该过程的凭据,以便用户可以访问数据库(在SQL Server中列为登录名).在桌面上运行该应用程序时,将使用您的用户帐户,因此情况略有不同.

尝试解决此问题的简单方法是使用用户名和密码创建一个经过SQL Server身份验证的用户.之后,更改您的连接字符串:
Do you get any error message about the connection. Since you''re using a trusted connection, the credentials running the process should be defined so that the user has access to the database (is listed as a login in the SQL Server). When you run the app in the desktop, your user account is used so it''s a bit different situation.

Simple way to try if this is the problem is that create a SQL Server authenticated user with username and password. After that change your connection string:
<connectionStrings>
 <add name="BuiltTech" connectionString="Dsn=built;app=Microsoft® Visual Studio® 2008;wsid=PRASHANTH;database=BuiltMaster;network=DBMSSOCN;trusted_connection=No;User=<UserName>;Password=<Password>"

  providerName="System.Data.Odbc" />
</connectionStrings>


要发布您的网站:在解决方案资源管理器中右键单击您的项目->选择发布->给出虚拟目录的名称->好的.

您的站点将在本地PC IIS中发布.请参阅此链接 [
To publish your web site : right click on your project in solution explorer -> select publish -> give the name for the virtual directory -> OK.

your site will publish in local pc IIS. see this link[^] , this may help you.


这篇关于如何在IIS中执行ASP.NET项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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