app.config.

app.config.

Postby 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!
Partalakos
 
Posts: 7
Joined: Wed 21 Jul 2010 17:34

Postby 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");
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby 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.
Partalakos
 
Posts: 7
Joined: Wed 21 Jul 2010 17:34


Return to dotConnect for MySQL