app.config.

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
Partalakos
Posts: 7
Joined: Wed 21 Jul 2010 17:34

app.config.

Post by Partalakos » Mon 09 Aug 2010 09:25

Hello everyone.

i work with dotconnect for mySQL a few months now. and i just see when i create the datacontext it create a file app.config in my project and it store the connection info. How it is possible to disable that and store the connection info inside my code? Because like that everyone can see and access mysql Server info. it is possible devart to do that automatic or i need to edit the code alone ?.

Thanks in advance!

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Mon 09 Aug 2010 12:42

The simplest solution is to remove the connection string from the app.config file and to create the DataContext instance using the parameterized constructor that takes a connection string like in the following example:

Code: Select all

DataContext1 context = new DataContext1("host=MyHost;user id=root;password=***;database=test");

Partalakos
Posts: 7
Joined: Wed 21 Jul 2010 17:34

Post by Partalakos » Mon 09 Aug 2010 13:15

Thanks you very much for your Fast support AndreyR!
That solve my problem, hehe i don't even think about that :)
works like a charm.

Post Reply