I was given a console app to be moved to a different server. I also need to move tables used by this application to a different server/database. The new database has a different name. The app was converted I believe from VS2005 to VS2010 before me some time ago. I changed the connection string in the app config. This project contains entity model. I noticed in one of the auto generated model files this line: [global::System.Data.Linq.Mapping.DatabaseAttribute(Name="OldDatabaseName")]
This is an autogenerated file. Is there a way to not reference the old database without recreating the model and rebuilding the app? Thank you, Jenny
Assuming the underlying tables have the same names, structures and constraints, all you would need to do is change the connection string in the configuration file and this generated file to point to the new database.
It is also worth changing the database properties of the
.edmx
file to ensure it is consistent with the above, in case you do regenerate the file.