Last post Apr 21, 2011 04:01 AM by frez
Apr 21, 2011 02:42 AM|AlanT|LINK
I have created an assembly of data access classes accessing MySQL (or it does not matter what DB) by getting the connection string from web.config.
That connection string is retrieved by the base data access class assuming that assembly distributed with ASP.NET application.
Now I want to re-use this assembly with a non ASP.NET application. But find no way to 'assign' the connection string to the data access base class as there is no web.config file in a Windows .NET project.
Apr 21, 2011 04:01 AM|frez|LINK
If it is a winforms project that wants to share your data access class then you can put the connection string in its app.config file. You could then pass the connection string into the class constructor so the class is independant of what presentation layer
you are using.