Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
There is already an object named 'tableName' in the database

i am working with wpf application and i want to create database with entity framework, i take this error. This error appears for table..

'There is already an object named '##tbl' in the database'

i have used 2 dll's in my wpf application
1. Microsoft.Kinect
2. Microsoft.Kinect.Wpf.Controls


if i remove this 2 dlls and run application for fresh database, then everything is going fine..

googled lot but found nothing, why on inclusion of those two dlls getting above exception..

really frustrated... Pls...
Posted
Comments
[no name] 29-Dec-14 4:49am    
I think here you might be using the same table name each time. Try to use some different table name and try once.
umesh_vn 6-Jan-15 7:30am    
thanks for reply.. i installed kinect runtime environment on same machine where i used to run kinect application..
Gold$Coin 6-Jan-15 22:27pm    
It's better to use SQL Profiler, it will help you where exactly the query is getting executed and when. Hope it will help you to narrow down the problem.

1 solution

I really believe that you have yourself provided the answer to your problem. The problem here is that inside your database 'tableName' is already present that you're trying to recreate. Which in turn creates an error in the logic and gives you this error.

Quote:
if i remove this 2 dlls and run application for fresh database, then everything is going fine..


Now when the database is a fresh version, that means there is no table with that name so it creates and the code goes fine.

I would like to make an advise that where ever you're trying to create this table or object, you must add a new if else block to create this table only if there is no table in the database. If there is a table, then it must skip this line.
 
Share this answer
 
v2

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