点击文章分类出错

zhangjianying
博客专家认证
2007-09-07 08:31:30
我的blog地址: http://blog.csdn.net/zhangjianying/
当我点击文章分类地址想看某一分类文章的时候就会提示:


出错啦!!
错误类型:NullReferenceException
错误信息:Object reference not set to an instance of an object.

请问我应当如何修复这些错误。谢谢了

...全文
78 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
CSDN官方博客 2007-10-12
  • 打赏
  • 举报
回复
请告诉我们您用的模版名称,我们会尽快修改
ruanchao 2007-10-02
  • 打赏
  • 举报
回复
google上搜索一下呀
ruanchao 2007-10-01
  • 打赏
  • 举报
回复
Steps to Reproduce the Behavior
1. Create a new Microsoft Visual C# project named ADORefError. By default, WebForm1.aspx appears.
2. On the Project menu, click Add Reference.
3. On the .NET tab, select adodb from the drop-down list.
4. Click Select, and then click OK.
5. Drag a Label control from the toolbox to WebForm1.aspx.
6. In Solution Explorer, right-click WebForm1.aspx, and then click View Code.
7. Paste the following code in the Page_Load event:

Note You must change the User Id <user name> value to an account that has the appropriate permissions to perform these operations on the database.
//Create ADODB Objects
ADODB.Connection oConn = new ADODB.ConnectionClass();
ADODB.Recordset oRS = new ADODB.RecordsetClass();

//Change Connection String depending on your SQL Server
string strConn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=<username>;Initial Catalog=pubs;Data Source=Your SQLServer Name";

oConn.Open(strConn,"","",0);
object objRecs = 100;
oRS = oConn.Execute("select au_Id, au_lname from authors", out objRecs,0);

//Error is generated by referencing the Fields collection
Label1.Text = oRS.Fields["au_id"].Value.ToString();

//Close all connections
oRS.Close();
oConn.Close();

//Release COM Objects
oRS = null;
oConn = null;



8. Copy Adodb.dll (from the C:\Program Files\Microsoft.NET\Primary Interop Assemblies\ folder) to the Bin folder of the ADORefError application.
9. On the Build menu, click Build Solution.
10. Start Microsoft Internet Explorer, and then browse to WebForm1.aspx by specifying the following URL, where IISServerName is the name of your Microsoft Internet Information Services (IIS) server:

http://IISServerName/ADORefError/WebForm1.aspx
11. Identify a test computer that has the .NET Framework installed (without Microsoft Visual Studio .NET). In IIS, create two virtual directories and name them Test1 and Test2.
12. Create two identical sites: from the ADORefError folder, copy WebForm1.aspx and the Bin folder to the Test1 and Test2 folders on the test computer.
13. Start Microsoft Internet Explorer and browse to WebForm1.aspx of Test1 site by specifying the following URL, where IISServerName is the name of your Microsoft Internet Information Services (IIS) server:
http://IISServerName/Test1/WebForm1.aspx
14. Start another instance of Microsoft Internet Explorer and browse to WebForm1.aspx of Test2 site by specifying the following URL:
http://IISServerName/Test2/WebForm1.aspx
15. When you access WebForm1.aspx of Test2, you receive the error message as detailed in the SYMPTOMS section.
jakecool123 2007-09-18
  • 打赏
  • 举报
回复
是模板的问题
听说又发布了新版本
我还以为这写问题解决了呢

可当我换成我喜欢的那些模板的时候
还是一样没改过来

我就纳闷
这个模板的问题就那么难解决吗?
应该不是很难吧
liugz05182 2007-09-18
  • 打赏
  • 举报
回复
bug百出,bug百出。
真相重于对错 2007-09-09
  • 打赏
  • 举报
回复
程序 bug
zhangjianying 2007-09-08
  • 打赏
  • 举报
回复
顶 放乐2天了也没人看一个......

590

社区成员

发帖
与我相关
我的任务
社区描述
提出问题
其他 技术论坛(原bbs)
社区管理员
  • community_281
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧