Why Mojoportal use to get the connectionstring from appsetting?

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
8/26/2013 2:14:00 AM
Gravatar
Total Posts 22

Why Mojoportal use to get the connectionstring from appsetting?

Hi,

Why Mojoportal used to get the connection string from appsetting instead of using the <connectionstring> section, Is there any security issue of using <connectionstring> section ?

Thanks,

Rajeswari.

8/26/2013 11:39:54 AM
Gravatar
Total Posts 18439

Re: Why Mojoportal use to get the connectionstring from appsetting?

Hi,

2 reasons.

1. The project was started back in the .NET 1 era when there was no separate section for connection strings

2. appSettings section has the advantage where a default value can be in web.config and then you can override it from a separate file as we do in user.config. This makes things much easier for developers who are working from the source code repository because we don't have to modify web.config to add our connection string, we use user.config which is not under source control.

<connectionStrings section can be put in a separate file but it is an either or thing, that is if we point the section to an external file then the file must exist or an error will happen so the separate file would also have to be in source control and would have to be modified by each developer to point to their local database.

Whereas settings in <appSettings file="user.config">

can still have a settings with the default value in web.config and no error happens if user.config file does not exist, but if it does exist and the setting is there is will be used instead of the one in Web.config. So in source control the user.config file does not exist and developers can add one with no conflicts.

This also helps for upgrades because we do not ship a user.config file in our package, therefore during upgrades the connection string in user.config is never lost and there is less maintenance of custom settings.

​So when the <connectionStrings section was introduced in .NET 2.0 we did not see any compelling advantage to change to use it and we continued to use <appSettings because it has advantages not provided by the <connectionString section..

Hope that helps,

Joe

8/27/2013 7:06:27 AM
Gravatar
Total Posts 22

Re: Why Mojoportal use to get the connectionstring from appsetting?

Thanks Joe, I have one samll doubt on this, if we trying to use the mojoPortal Setup system to install my tables and other database object like stored procedures then it won't work with <connectionstring section right we must use the <appsettings.
 

8/27/2013 8:03:51 AM
Gravatar
Total Posts 18439

Re: Why Mojoportal use to get the connectionstring from appsetting?

That is correct. 

You must sign in to post in the forums. This thread is closed to new posts.