System.data.sqlclient.sqlexcep ... [英] System.data.sqlclient.sqlexcep...

查看:62
本文介绍了System.data.sqlclient.sqlexcep ...的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我正在尝试使用MVC实体框架中的IP连接到数据库服务器,但我在连接时遇到以下错误。



错误: System.Data.SqlClient.SqlException:无效的对象名称'登录'。









请提供相同的解决方案。



我试过的:



连接字符串



Hi
I am trying to connect to database server using IP in MVC Entity Framework but I get the below error while connecting.

Error: System.Data.SqlClient.SqlException: Invalid object name 'Login'.




Please provide the solution for the same.

What I have tried:

Connection String

<add name="SBSDEntities" connectionString="metadata=res://*/Models.XXXX.csdl|res://*/Models.XXXX.ssdl|res://*/Models.XXXX.msl;provider=System.Data.SqlClient;provider connection string="data source=xxx.xxx.xxx.xx;initial catalog=ABC;persist security info=True;user id=XX;password=XXXX;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />

推荐答案

这通常只是意味着配置问题;



1.每haps那里真的没有这样的桌子

2.也许桌子就在那里,但不是dbo计划(可能在Fred.Categories中)

3。也许数据库区分大小写(这很好),表格实际上是dbo.CATEGORIES



任何这些都会导致上述异常。特别是,你声明:



我的数据库包含6个表,其中一个是Category。



现在到机器,类别!=类别
This usually simply means a configuration issue;

1. perhaps there genuinely is no such table
2. perhaps the table is there, but isn't the the dbo scheme (it might be in Fred.Categories)
3. perhaps the db is case-sensitive (which is fine), and the table is actually dbo.CATEGORIES

Any of these will cause the above exception. In particular, you state:

My database contains 6 tables and one of them is Category.

Now to a machine, Category != Categories


这篇关于System.data.sqlclient.sqlexcep ...的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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