asp.net网站移植问题

cathie 2004-04-29 08:53:17
现在的情况是,一台机器是数据库服务器A,一台是Web服务器B,还有我自己的开发机器C,我在C上开发好了一个网站,数据库连接的是A,然后想移植到B上,但是出错。错误提示:
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
jianzhi.WebForm1.Page_Load(Object sender, EventArgs e) +50
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731

我自己查看了一下,好像是只要有数据库连接的页面都无法打开,都提示是Object reference not set to an instance of an object. 我自己把数据库连接封装了一下,写道dll里面了,请问是这个dll出错了么?我在C上连接A是好的啊,为什么在B上连接A却不行?
...全文
111 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cathie 2004-04-29
  • 打赏
  • 举报
回复
知道原因了,在B上装一个sql server就行了
cuike519 2004-04-29
  • 打赏
  • 举报
回复
你给的这些信息只能看出来你有地方声明对象但是没有实例化这个对象!

// 未将对象引用设置到对象实例

62,248

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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