请用过<<ASP.NET Web 站点高级编程>>一书的源码的大侠进来看看!谢谢!
我在正常运行此书的源码的Default.aspx后,打开该网站论坛上的任何一篇文章,如下,确报错如下,我注释了很多代码后还报错啊!请问这是报的一种什么错啊??我该怎样处理才能不报错啊?谢谢!打开该网站论坛上的任何一篇文章,如下网址所示
http://www.jzfybjy.com/liou/sccx/uploadfile/342135.jpg确报错如下
Page Error--------------------------------------------------------------------------------
An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.
The error occurred in: http://localhost/ThePhile/Modules/Forums/Topic.aspx?TopicID=50
Error Message: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。 
--------------------------------------------------------------------------------
Stack Trace:
System.Data.SqlClient.SqlException: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at Wrox.WebModules.Data.DbObject.RunProcedure(String storedProcName, IDataParameter[] parameters, String tableName) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Core\DbObject.cs:line 147 at Wrox.WebModules.Forums.Data.Replies.GetReplies(Int32 topicID, Int32 pageNumber, Int32 pageSize) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Forums.Data\Replies.cs:line 55 at Wrox.WebModules.Forums.Business.Topic.GetReplies(Int32 pageNumber) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Forums.Business\Topic.cs:line 145 at Wrox.WebModules.Forums.Web.Topic.BindGrid() in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Topic.aspx.cs:line 126 at Wrox.WebModules.Forums.Web.Topic.Page_Load(Object sender, EventArgs e) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Topic.aspx.cs:line 99 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain() 

解决方案 »

  1.   

    源码里又个index.htm,你看看没有找到什么index.htm啊!!!
      

  2.   

    ASP.NET Website Programming Code Download C# Edition
    Welcome! The following instructions provide a way to get the site running. If you follow these instructions but cannot make the site work then please contact -- Wrox Technical Support. we will do everything we can to help you, and where needed change the download for future readers.Before you start, you must have SQL Server and IIS installed and running., you can also use MSDE as your local database server, if your machine is running on windows 2000 professional. The procedure for database backup is same for both MSDE and SQL server 2000. Also Read the FAQ at End of doucment to solve some of commanly known problems [ Getting the Site Up and Running | Modifying the Web Data Administrator to Work in .NET 1.0 ] 
    Getting the Site Up and Running
    We connect to the database using the 'sa' account, with a blank password. This is not a good idea in a production system! If you want to build a live site then you will need to create other database accounts, and modify the connection string used in the config files.  Restore the thephile-database-backup database file in SQL Server Enterprise Manager 
    Copy the file thephile-database-backup.bak into your SQL Server backup folder 
    Create a new database called thePhile 
    Right click the new database, click All Tasks then Restore Database 
    Select From Device 
    Click Select Devices 
    Click Add 
    Use the filename box to select the thephile-database-backup.bak file. 
    Click OK 
    Click OK again 
    Click OK once more 
    Unzip wrox.zip (nested in the main download zip) to c:\, so that there are folders c:\wrox\keys and c:\wrox\thephile
    Web-share the c:\wrox\thephile folder as thephile: 
    Right-click on the thephileVB folder in Windows Explorer, and select Properties 
    Click the Web Sharing tab 
    and select Share This Folder 
    Ensure that the Alias reads thephileVB 
    Set execute Permissions for the application by selecting the radio buttion in the application permission section of the dialog box. It makes it easier to hack around with the site if you also check Directory Browsing 
    Click OK 
    Click OK again
    Open the file c:\wrox\thephile\thephile.sln in Visual Studio .NET or Visual C# Standard 
    You also need to change the name of database server in the following files listed below: 
    Web.config 
    All the config files residing in the C:\wrox\ThePhile\Config\ folder. Rebuild the Solution in VS.NET 
    Open Machine.Config (by default in C:\WINNT\Microsoft.NET\Framework\v1.0.3705\CONFIG) in a text editor, find the <processModel> section, and set the userName attribute to "SYSTEM". This is required to enable event logging in ASP.NET Applications -- which we use in our custom error handling. 
    Reboot the computer. This will enable the change to Machine.Config to take effect 
    Navigate to http://localhost/thephile 
      

  3.   

    Modifying the Web Data Administrator to Work in .NET 1.0
    Chapter 4 mentions the Web Data Administrator. Microsoft produced this tool for .NET beta 2, and have yet to update it. Wrox cannot redistrubute a modified version of the tool, but following these steps has made the tool work for me.This is just a hack -- I don't completely understand how this tool works, I just tried something, and it appeared to work. Please do not rely on or trust these instructions!Also, if you find ways to improve this hack, please email supportDownload the tool from MSDN 
    Install it 
    Navigate to the source sub-folder (by default C:\Inetpub\wwwroot\DataAdmin\source), and web-share the webdatadmin folder, giving it the alias sqlwebadmin 
    Open WebDataAdmin.sln in Visual Studio .NET 
    Open the codebehind for default.aspx (part of the SqlWebAdmin project) and comment out the first two lines in the page_load method:
    // if (!IsValid)
    //    return;
    Rebuild the solution 
    Navigate to http://localhost/sqlwebadmin 
     FAQQuestion 1I have successfully able to build the solution, but when I try to access the default.aspx page it gives me security exception similar to the one as described below. Server Error in '/ThePhile' Application.
    --------------------------------------------------------------------------------Access is denied
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.ComponentModel.Win32Exception: Access is deniedSource Error:
    Line 31: EventLog.CreateEventSource("ThePhile.COM", "Application");
    Line 32: }
    Line 33: EventLog.WriteEntry("ThePhile.COM", message, entryType);
    Line 34: }
    Line 35: 
    Answer There are few possible solutions to this problem Change the security settings of your virtual directory named "ThePhile". As this virtual directory use IUSR_MACHINENAME account by default, which is a member of GUEST and has the privileges of GUEST account. In this case GUEST account is disabled on your system. Enable the Guest account 
    Provide write permission to the ASPNET or asp_wp accountaccount on the file below 
    C:\WINNT\system32\config\AppEvent.EvtSo, you have to add write permission to the account you use for aspnet process execution on this file. Be ensure that your IIS disallow an anonymous access. 
    You can also turn off the logging by commenting the line below 
    EventLog.WriteEntry("ThePhile.COM", message, entryType); Question 2 I am getting this Error Message: SQL Server does not exist or access denied. How should I solve this problemAnswerYou have probably not changed the connection string in various config files residing the config folder as described in the readme file. Follow the steps given below. Change the connection string settings in web.cong file 
    Change the connection string settings in all the config files residing in the config folder. Question 3I am facing problem with the SQL Server Connection it says "Login failed for user 'sa'. Reason: Not associated with a trusted SQL Server connection". How should I solve this problem. Answer.Users with SQL Server 2000 or using MSDE with Enterprise Manager InstalledTo resolve this problem, You need to change it to SQL Server authentication mode using Enterprise manager from widows only to SQL Server and Windows Mode. Please follow the steps given below. Right click on your SQL SERVER INSTANCE NAME and select properties
    Select the security tab and change the authentication to SQL server and Windows. Users with MSDE stand alone without enterprise managerIf you do not have enterprise manager on your machine, there is one possible solution is described at the Microsoft Knowledge Base. These articles will give you in-depth information on the various topics such as changing the MSDE authentication mode From Windows integrated to mixed mode at the time of installation and even after the installation. Just browse the two URLs give below.http://support.microsoft.com/default.aspx?scid=kb;en-us;319930http://support.microsoft.com/default.aspx?scid=kb;en-us;322336
    Question 4 I am facing problem with site. When I try to access the default.aspx, I get the following error. Error Message 
    Access to the path
    "C:\wrox\ThePhileVB\Config\Polls.Config is denied. Or Error Message 
    Access to the path
    "C:\wrox\ThePhile\Config\Polls.Config is denied. AnswerYou need to modify the FileStream constructors in the ModuleConfig.vb or ModuleConfig.cs files as described below. Users with VB.NET version of Code
    Dim fs As New FileStream(fileName, FileMode.Open, FileAccess.Read)Users with C# version of Code
    FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);Enjoy!Ankur Verma , Charul Shukla
    Technical Support
      

  4.   

    我遇到过同样的问题
    只要你把数据库里的数据类型text改为verchar(7000)就行
    这个原因主要是
    text不支持代码页1252 到: 代码页936
    而verchar支持
      

  5.   

    hj5182001(天行健) ,我按你的方法把库中表Forums_Topics 的Message的数据类型text改为varchar(7000) 可还是报错同上,请问我错在哪啊??谢谢!
      

  6.   

    请用过<<ASP.NET Web 站点高级编程>>一书的源码的大侠进来看看!谢谢!
    我在正常运行此书的源码的Default.aspx后,打开该网站论坛上的任何一篇文章,如下,确报错如下,我注释了很多代码后还报错啊!请问这是报的一种什么错啊??我该怎样处理才能不报错啊?谢谢!打开该网站论坛上的任何一篇文章,如下网址所示
    http://www.jzfybjy.com/liou/sccx/uploadfile/342135.jpg确报错如下
    Page Error--------------------------------------------------------------------------------
    An unexpected error has occurred on this page. The system administrators have been notified. Please feel free to contact us with the information surrounding this error.
    The error occurred in: http://localhost/ThePhile/Modules/Forums/Topic.aspx?TopicID=50
    Error Message: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。 
    --------------------------------------------------------------------------------
    Stack Trace:
    System.Data.SqlClient.SqlException: 对 text 数据类型不支持代码页转换。从: 1252 到: 936。 at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior) at System.Data.SqlClient.SqlCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) at Wrox.WebModules.Data.DbObject.RunProcedure(String storedProcName, IDataParameter[] parameters, String tableName) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Core\DbObject.cs:line 147 at Wrox.WebModules.Forums.Data.Replies.GetReplies(Int32 topicID, Int32 pageNumber, Int32 pageSize) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Forums.Data\Replies.cs:line 55 at Wrox.WebModules.Forums.Business.Topic.GetReplies(Int32 pageNumber) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Forums.Business\Topic.cs:line 145 at Wrox.WebModules.Forums.Web.Topic.BindGrid() in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Topic.aspx.cs:line 126 at Wrox.WebModules.Forums.Web.Topic.Page_Load(Object sender, EventArgs e) in G:\新建文件夹装网页制作教程.flash.ps.vc++.vb\装c#编程\c#学习教程\ASP.NET Web 站点高级编程——提出问题-设计方案-解决方案\正在用 源码1\ThePhile\Modules\Forums\Topic.aspx.cs:line 99 at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain()