Not to drop database or tables with EF4.1? - asp.net-mvc-3

Is there a way to make Entity Framework 4.1 Code First NOT to drop database or the tables, not even if its changed? Im suppose to upgrade a LIVE site and I cant because of this. I seen some NuGet classes I can get but its to not drop database but tables, recreate tables on change ect.. i just do not want to do anything to the database or the tables.

In the startup of your application add this:
Database.SetInitializer<YourContextType>(null);
This should remove any initialization strategy.

Related

Datagrip - table names do not appear when clicking on schema names in left-hand panel

I recently installed Datagrip to view my Company's Postgres database, however I am currently unable to view the tables in the different schemas by clicking on the schema name:
In the image, I've clicked to open and show the ab-testing schema, however nothing appears below it. This behavior is consistent across all of the schemas in the database. I am able to use the query editor to query tables in the schemas (assuming i know the table names), yet I cannot see the names in the left-side panel. I am using datagrip 2020.2
Thanks!
I had the same problem with a MySQL database. As a test, I used the MariaDB driver instead of the MySQL driver as usual. This was intentional and not an oversight, but it was not a good idea!
The tables, views and server objects were not displayed. Although I was able to display the tables and views after activating Schema Properties -> Advanced -> "Introspect using JDBC metadata", the server objects were not displayed. Working with the displayed tables and views was not possible in the usual way.
Only when I used the MySQL driver again, everything worked correctly again. The tables, views and server objects were displayed correctly and the work with it was possible in the usual way.
As a small quintessence I would like to recommend to all who "struggle" with similar problems to check your chosen drivers. Maybe the problem is caused by choosing the wrong driver, as it was in my case.
Whick kind of message do you get when instrospecting the schema?
I had a java.io.CharConversionException caused by a not valid UTF-8 string.
If this is the case, you can add the following VM option -Ddb2.jcc.charsetDecoderEncoder=3.

What are these automatically created tables in my oracle DB?

I noticed that my oracle db automatically creates tables with names such as #T10_sid:201349704_1_FiltFilte.
Does anyone know how these tables are created / what creates them? They are starting to clog up my table list so I would also like a way to automatically remove them (as long as they are not needed).
Can anyone help me there?
Edit:
I am using Oracle SQL Developer, if that makes any difference.

ORACLE Application Development Framework

Hello I am trying to build an application using Oracle ADF.
I have designed my database using Oracle Workbench have all the tables in the database already linked.( be it one to many or one to one mapping with the primary and foreignm keys.) i hope to include triggers too.
My problem is when i do all these links in workbench.
Will it automatically link the tables up using Association when i I load the tables as entities.
Will it also create views and view links too for me.
Or i should just create the tables in the database and do the associations and links in jdeveloper instead when i start working on the UI of my project.
If you use New - Business Tier - ADF Business Components - Business Components from Tables and go through the wizard pointint your tables in the database, JDeveloper should create Entities, link them with Associations, also create View Objects and link them with View Links based on your tables' foreign keys.
Triggers won't be reflected in the application.

build schema for specific tables in database using doctrine?

In my symfony project i need to generate schema from specific tables not all database tables ,so please tell the way to do if it is possible?
If you use the command build-schema you can generate a schema from the database that is configured for the project. The schema.yml in the config folder should contain all the tables, and you can delete the tables you do not need, and then use the commands build-model, build-form, and build-filters in order to create the classes for the remaining tables. This way, there will only be classes for the tables that you want.
Hope this helps!

"Update Model From Database" does not work in .edmx Entities file. My Database is DB2

I am trying to reflect new changes or add a new table to my model in EDMX file using 'Update Model From Database.' Then i get this error message in Update Wizard saying "Error retrieving Database information. An Item with the same key has already been added."
I am using DB2 database and VS 2010.
Please let me know how i can add a new table or reflect the changes to my model with the changes made to the database. Right now i am deleting the entire model and recreating the new one.
Any help is appreciated.
I was getting this same error. In my case with DB2 9.5 LUW the solution was to remove duplicate named stored procedures on the server. DB2 lets you have multiple stored procs with the same name but different definitions (ie different parameters). But apparently this isn't compatible with Entity Framework. Fortunately for me the duplicates were actually unused old versions.
An alternative is to edit your EDM file in XML editor mode.
I have followed the solution provided by vikrantislav. And in addition to that, I made one more change. By default EF tool brings objects from all the exiting schemas. So make sure you don't have duplicate store procedures in any of those schemas or change the connection properties to filter out by a specific schema. In my case I have filtered out by specific schema as I don't want to mess up with someone else's store procedures in other schemas. And now "update model from database" wizard started working. what a relief.
Schema filter in connection properties window

Resources