问题描述
请教:问题一:VisualC#2005运行一个源码时,为什么不能生成网页,而只是生成文件目录?谢谢!http://localhost:4160/WebSite2/目录清单--/WebSite2/--------------------------------------------------------------------------------Saturday,May10,200804:05PM<dir>App_CodeSaturday,May10,200804:05PM<dir>DB_51aspxSaturday,May10,200804:05PM<dir>imageSaturday,May10,200804:05PM<dir>pictureSaturday,January05,200812:14PM3,795addbook.aspxSaturday,January05,200812:14PM2,063addbook.aspx.csSaturday,January05,200811:10AM3,372admin.aspxSaturday,January05,200812:14PM3,097admin.aspx.csSaturday,January05,200803:40PM4,343admin.masterFriday,December07,200711:29AM412admin.master.csSaturday,January05,200812:14PM1,988adminSpeaking.aspxSaturday,January05,200812:14PM1,515adminSpeaking.aspx.csSaturday,January05,200812:13PM8,736book.aspxWednesday,January16,200809:29AM2,196book.aspx.csFriday,January04,200808:35PM3,147book.masterMonday,December17,200702:31PM411book.master.csSaturday,January05,200812:13PM4,370bookBuy.aspxSaturday,January05,200812:13PM3,181bookBuy.aspx.csSaturday,January05,200812:14PM2,892bookinfo.aspxSaturday,December08,200702:29PM1,257bookinfo.aspx.csFriday,January04,200808:35PM3,675bookPage.masterMonday,October29,200708:04PM415bookPage.master.cs.....问题二:老生常谈的问题:用户代码未处理System.Data.SqlClient.SqlExceptionMessage="在建立与服务器的连接时出错。在连接到SQLServer2005时,在默认的设置下SQLServer不允许进行远程连接可能会导致此失败。(provider:命名管道提供程序,error:40-无法打开到SQLServer的连接)"Source=".NetSqlClientDataProvider"ErrorCode=-2146232060Class=20LineNumber=0Number=2Server=""State=0StackTrace:在System.Data.SqlClient.SqlInternalConnection.OnError(SqlExceptionexception,BooleanbreakConnection)在System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjectstateObj)在System.Data.SqlClient.TdsParser.Connect(ServerInfoserverInfo,SqlInternalConnectionTdsconnHandler,BooleanignoreSniOpenTimeout,Int64timerExpire,Booleanencrypt,BooleantrustServerCert,BooleanintegratedSecurity,SqlConnectionowningObject)在System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfoserverInfo,StringnewPassword,BooleanignoreSniOpenTimeout,Int64timerExpire,SqlConnectionowningObject)在System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(Stringhost,StringnewPassword,BooleanredirectedUserInstance,SqlConnectionowningObject,SqlConnectionStringconnectionOptions,Int64timerStart)在System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnectionowningObject,SqlConnectionStringconnectionOptions,StringnewPassword,BooleanredirectedUserInstance)在System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentityidentity,SqlConnectionStringconnectionOptions,ObjectproviderInfo,StringnewPassword,SqlConnectionowningObject,BooleanredirectedUserInstance)在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptionsoptions,ObjectpoolGroupProviderInfo,DbConnectionPoolpool,DbConnectionowningConnection)在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionowningConnection,DbConnectionPoolpool,DbConnectionOptionsoptions)在System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnectionowningObject)在System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnectionowningObject)在System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnectionowningObject)在System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnectionowningConnection)在System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnectionouterConnection,DbConnectionFactoryconnectionFactory)在System.Data.SqlClient.SqlConnection.Open()在BookStore.BookStoreDBO.GetBookCategories()位置f:工程文件WebSite3App_CodeBookStoreDBO.cs:行号244在BookStore.Menu.Page_Load(Objectsender,EventArgse)位置f:工程文件WebSite3Menu.ascx.cs:行号33在System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtrfp,Objecto,Objectt,EventArgse)在System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Objectsender,EventArgse)在System.Web.UI.Control.OnLoad(EventArgse)在System.Web.UI.Control.LoadRecursive()在System.Web.UI.Control.LoadRecursive()在System.Web.UI.BasePartialCachingControl.LoadRecursive()在System.Web.UI.Control.LoadRecursive()在System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint)
解决方案
解决方案二:
1、你没有设置起始页2、请google搜索错误关键词
解决方案三:
恩,关于问题一的具体操作如何做?问题二倒是有很多解决方法,但就是不凑效哈~还望指教下,特别是问题一。您是说我在设置IIS的时候,没有设置起始页?那为什么有的源码又可以直接生成网页?
解决方案四:
up
解决方案五:
还望指教下,特别是问题一。您是说我在设置IIS的时候,没有设置起始页?那为什么有的源码又可以直接生成网页?人家是有default.aspx,IIS默認的首頁,你沒有這個阿.问题二倒是有很多解决方法,但就是不凑效哈~在BookStore.BookStoreDBO.GetBookCategories()位置f:工程文件WebSite3App_CodeBookStoreDBO.cs:行号244在BookStore.Menu.Page_Load(Objectsender,EventArgse)位置f:工程文件WebSite3Menu.ascx.cs:行号33,行號都出來,自己去調適吧.
解决方案六:
引用4楼wonder225的回复:
问题二倒是有很多解决方法,但就是不凑效哈~在BookStore.BookStoreDBO.GetBookCategories()位置f:工程文件WebSite3App_CodeBookStoreDBO.cs:行号244在BookStore.Menu.Page_Load(Objectsender,EventArgse)位置f:工程文件WebSite3Menu.ascx.cs:行号33,行號都出來,自己去調適吧.
晕,请指出来这一行为什么导致错误?关键是要解释:在连接到SQLServer2005时,在默认的设置下SQLServer不允许进行远程连接可能会导致此失败。(provider:命名管道提供程序,error:40-无法打开到SQLServer的连接)