New Posts New Posts RSS Feed: Duplicate Table Names in Different Databases
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Duplicate Table Names in Different Databases

 Post Reply Post Reply
Author
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Topic: Duplicate Table Names in Different Databases
    Posted: 12-Jul-2007 at 11:27am
I have a PartsMaster table in database A, and a [PARTS MASTER] table in database B.  The A table has been in existence in my project for quite some time.  Today, I needed to access the older B table and incorporate it into my project.  I was going to call it oldPartsMaster; however, when I added the class, the name was automatically changed to PARTSMASTER (space was removed).  This is not good, because when I renamed the table to oldPartsMaster, it deleted the original PartsMaster.cs file.  Now, when I save the ORM and rebuild the Model project, it errors, stating that the PartsMaster.cs file is not found.  And, it really isn't there anymore.  I closed the object mapper and told it not to save the changes (too late!).  Even if I open it again and try to recreate the table, I get the same error.
 
Solution:  Delete from the ORM the PartsMaster class that is missing.  Add the oldPartsMaster class.  ReAdd the PartsMaster class.  Save.
 
The BIG problem now is recreating any custom code in the PartsMaster class that was lost:  Create method, Custom properties, etc.  I did not even think to record this elsewhere before making these changes.  Long ago, I removed VSS because it caused far more problems that it is worth.  My next option is to find a backup.  At least, I could copy/paste the customizations into the newly created class.
 
Has IdeaBlade considered this renaming thing and the potential damage to existing classes?  Any solutions on your part?  Perhaps I am doing something wrong in my approach.
 
Thanks!
Bill
Back to Top
Linguinut View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 394
Post Options Post Options   Quote Linguinut Quote  Post ReplyReply Direct Link To This Post Posted: 12-Jul-2007 at 12:13pm
Unfortunately, the solution was only partial.  I had to manually change some naming in the oldPARTSMASTER.cs file.  The constructors section had labelled the partial class as PartsMaster.  That obviously conflicted with the real class' constructors.  Confusing, at best.  I hope it was just me doing something wrong.  After the Model build, it all looks OK; however, my next plan is to run the ORM again.  Crossing fingers.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down