Page 1 of 1

app.config.

Posted: Mon 09 Aug 2010 09:25
by Partalakos
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!

Posted: Mon 09 Aug 2010 12:42
by AndreyR
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");

Posted: Mon 09 Aug 2010 13:15
by Partalakos
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.