Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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" />
Posted
Updated 21-Apr-16 22:39pm
Comments
Herman<T>.Instance 22-Apr-16 3:23am    
It is a SqlExecption. Which SQL statement is executed by the DB?
madhav_jain 22-Apr-16 3:28am    
table name login is not present in connected DB. check in DB login table is present or not.
mayank.bhuvnesh 22-Apr-16 4:26am    
Table name exists in DB... Checkd many times with dis...
madhav_jain 22-Apr-16 4:43am    
try this Open SQL Server Management Studio go to Edit -> IntelliSense -> Refresh Local Cache
phil.o 22-Apr-16 5:33am    
Which line is throwing the exception? Please show us this line, and try to indicate which SQL query is then executed.

1 solution

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
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900