Page 1 of 1

Problem with database name on string connection

Posted: Fri 23 May 2014 09:51
by adrian.chifan
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.

Re: Problem with database name on string connection

Posted: Tue 27 May 2014 10:15
by Shalex
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.