DAL Layer cant get MSSQLString when using WCF

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.
2/13/2012 4:05:28 AM
Gravatar
Total Posts 50

DAL Layer cant get MSSQLString when using WCF

Hi , any one is experience on WCF on mojo ? 

I try to access the data layer while using a WCF services , but the DAL layer return a empty string when i try to get the MSSQL string by using ConfigurationManager.AppSettings["MSSQLConnectionString"] or WebConfigurationManager.AppSettings["MSSQLConnectionString"];  

The data layer class can get the MSSQLConnectionString while direct refer to it class. 

Any one have the solution of this ? 

thanks 

2/13/2012 9:46:52 AM
Gravatar
Total Posts 50

Re: DAL Layer cant get MSSQLString when using WCF

Finally i get this problem solved. 

Modi the GetReadConnectionString() to 

private static string GetReadConnectionString()
{
System.Configuration.Configuration rootWebConfig =
System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/");

if (rootWebConfig.ConnectionStrings.ConnectionStrings.Count > 0)
{
return ConfigurationManager.AppSettings["MSSQLConnectionString"];
}
else
{
return string.Empty;
}
}

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