Problem with database name on string connection

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
adrian.chifan
Posts: 1
Joined: Fri 23 May 2014 09:24

Problem with database name on string connection

Post by adrian.chifan » Fri 23 May 2014 09:51

I created a Windows Forms project in Microsoft Visual Studio 2012. I added a data entity model (mysql database). After I publish the application, I changed in app.config the name of database, but the application is connecting to the old database. I think the application does not read connectionstring correctly. How can I solve this problem. Thank you.

PS: In the connectionstring the "host" works fine.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Problem with database name on string connection

Post by Shalex » Tue 27 May 2014 10:15

Please try the following:

1.Are you using Devart Entity Model (*.edml) or ADO.NET Entity Data Model (*.edmx)?
*.edmx: open it with XML Editor and remove all Schema attributes in the Store (SSDL) part of your model. This will remove schema prefixes from the SQL generated by Entity Framework.
*.edml: you can make the same changes (removing Schema attributes) in the designer (Entity Developer) which allows editing SSDL.
We recommend using Entity Developer (*.edml, the Devart Entity Model item).

2. Make sure that all context instances used in your code use connection string from *.config.

3. When debugging application, employ dbMonitor to find out the SQL which fails to execute:
http://www.devart.com/dotconnect/oracle ... nitor.html
http://www.devart.com/dbmonitor/dbmon3.exe

If this doesn't help, specify the exact text of the error and its call stack with all inner exceptions.

Post Reply