Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...connecting to different sql databaseconnecting to different sql database
Previous
 
Next
New Post
9/5/2012 7:22 AM
 

Hi 

i am tying to develop a new module in visual studio .net 2010, and for this modules i need to connect to different sql database to retrieve employee name and office number,, so i modified the web.config file and i added the following

---------------------------------------------
<connectionStrings>   
    <add name="Pr1ConString" connectionString="Data Source=SQLDB;Initial Catalog=PersonalDB;User Id=usr;Password=pass" providerName="System.Data.SqlClient" />

--Other Connection---

 </connectionStrings>
---------------------------------------------

and also i modified the Appsetting

---------------------------------------------
<appSettings>
        <add key="Pr1ConString" value="Data Source=SQLDB;Initial Catalog=PersonalDB;User Id=usr;Password=pass" />
--Other connection--
</appSettings>
---------------------------------------------

and i created a page with gridview and sqldatasource 

when i rebuild the solution it build successfully

but when i refresh the page that contains this module i am getting the following error

---------------------------------------------
Error: Get Employee Names is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: The connection name 'PR1ConnectionString' was not found in the applications configuration or the connection string is empty. ---> System.InvalidOperationException: The connection name 'PR1ConnectionString' was not found in the applications configuration or the connection string is empty. at System.Web.Compilation.ConnectionStringsExpressionBuilder.GetConnectionString(String connectionStringName) at GetEmpNames.GetEmpNames.__BuildControlSqlDataSource1() in c:\websites\dnndev\DesktopModules\GetEmpNames\GetEmpNames\View.ascx:line 7 at GetEmpNames.GetEmpNames.__BuildControlTree(GetEmpNames __ctrl) in c:\websites\dnndev\DesktopModules\GetEmpNames\GetEmpNames\View.ascx:line 1 at GetEmpNames.GetEmpNames.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\root\4733197c\30aa10a5\App_Web_6punkr7y.0.cs:line 0 at System.Web.UI.TemplateControl.LoadControl(IWebObjectFactory objectFactory, VirtualPath virtualPath, Type t, Object[] parameters) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc) at DotNetNuke.UI.Modules.WebFormsModuleControlFactory.CreateModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleControlFactory.LoadModuleControl(TemplateControl containerControl, ModuleInfo moduleConfiguration) at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---


can you help me ?

 
New Post
9/5/2012 7:48 AM
 
Sorry for that, but i solved the problem, the problem was that sqldatasource was not pointing to the prstring.
 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...connecting to different sql databaseconnecting to different sql database


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out