将表添加到本地数据库时,对象引用错误 [英] Object reference error when adding a table to local DB

查看:125
本文介绍了将表添加到本地数据库时,对象引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我通过右键单击网页添加了新的"SQL Server数据库".当我在服务器资源管理器中单击添加表"时,出现错误对象引用未设置为对象的实例".我在其他项目中也遇到相同的错误.

I have added added a new 'SQL Server Database' by right clicking on my webpage. When I click on 'Add table' in the server explorer I get the error 'Object reference not set to an instance of an object'. I get the same error with other projects.

有人可以帮我解决这个问题吗?

Could anyone help me fix this? 

谢谢

杰林特


推荐答案

以前是否运作良好?请以管理员身份重新启动VS,以检查结果.我创建了一个Web应用程序,在App_Data下添加一个SQL Server数据库,在服务器资源管理器中双击mdf文件,然后为数据库文件成功添加表.我不明白你的意思 我的VS2013上的问题.

Whether it worked fine before? Please restart VS as Admin to check the result. I created a web app, add a SQL Server Database under App_Data, double click the mdf file in Server Explorer, then add table for the database file successfully. I can't get your issue on my VS2013.

然后使用devenv/log(

Then use devenv /log(http://msdn.microsoft.com/en-us/library/ms241272(v=vs.120).aspx ) to gather activity.xm log to check whether there are any errors. If it shows some packages are corrupted, please repair or reinsatll your VS.  Maybeany third-party packages affected VS, please run VS under safe mode using devenv.exe/safemode to check whether the issue still occurs.Also you can try devenv.exe  /resetskippkgs and devenv.exe  /resetuserdata to fix.

最好的问候,


这篇关于将表添加到本地数据库时,对象引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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