Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Problem using multiple connection strings
Previous Previous
 
Next Next
New Post 5/27/2008 1:54 PM
Resolved
User is offline Qi
9 posts
10th Ranked


Problem using multiple connection strings 

I tried to create a custom module "MyLogin".  After passing DotNetNuke login, it should automatically check if the user is available for my login database. So I need to keep DotNetNuke connection, at the same time, need another connection string because my login module uses another database on the different server than DotNetNuke database. My problem is it always accesses DotNetNuke database, I cannot get my login database connection string.

Here is what I did.  

In web.config, I added section name SecurityLogin which is outside of <sectionGroupname="dotnetnuke">.

<sectionname="SecurityLogin"type="System.Configuration.SingleTagSectionHandler, system, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />

I also added the code within <connectionStrings>.

<addname="SecurityLogin"connectionString="Data Source=127.0.0.1;Initial Catalog=xxx;User ID= xxx;Password= xxx "providerName="System.Data.SqlClient"/>

Below code was added in <appSettings>.

<addkey="SecurityLogin"value="Data Source=127.0.0.1;Initial Catalog=xxx;User ID=xxx;Password=xxx"/>

I created a module MyLogin. In mylogin/sqlprovider.vb, I added the code:

Private Const ProviderType As String = "SecurityLogin"

_connectionString = ConfigurationManager.AppSettings("SecurityLogin")

In myLoginController.vb file, I have a function:

Public Function [Get](ByVal loginid As Integer) As tblloginInfo
            Return CType(CBO.FillObject(DotNetNuke.Data.DataProvider.Instance().ExecuteScalar("tblloginGet", loginid), GetType(tblloginInfo)), tblloginInfo)

End Function

But this code always calls DataProvider.vb and SQLDataProvider.vb under Library but not mylogin/DataProvider.vb and  mylogin/SQLDataProvider.vb. Can anyone help? why I can not get mylogin connection?

Thanks very much for any helps!!!
 
 
New Post 5/28/2008 1:49 AM
User is offline Wes Tatters
410 posts
8th Ranked




Re: Problem using multiple connection strings 

By default - DNN does NOT support accessing multiple data sources at the same time thru the SQLDataProvider.  

Which means that utilising the SQLDataProvider and DAL methodology for accessing a second database is not really appropriate.

There is however a way to utilise the DAL+ methodology and the SqlHelper.ExecuteReader() method
to do pretty much what you are looking for.

Have a look at the website below for more into on DAL+ and alternative databases.

http://www.adefwebserver.com/DotNetNukeHELP/DAL_and_DAL_Plus/Alternate_Database.htm

Note: DAL+ gives you most of the benifits of the DAL meothodology - but without alternative dataprovider support for oracle etc.
but for many people that is not a major issue since there seem to really be very few module developers that have the ability
or desire to create all the approriate support elements for multiple dataprovider support anyway.

PS - while still a work in progress in some respects LINQtoSQL will hopefully soon make all other DAL
solutions redundant - yes its still got some issues at the moment - but really fells like a much more elegant solution for the long term.
LINQtoSQL has cross dataprovider support - but does still have some issues with things like handleing prefixes and such

 
New Post 7/2/2008 7:16 AM
User is offline Qi
9 posts
10th Ranked


Re: Problem using multiple connection strings 

 

O.K. I found the inf0rmation from this site, it really works. I can access 4 different databases on the separate servers. Please see more inf0rmation from this link.

http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/111/threadid/121219/scope/posts/Default.aspx

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Problem using multiple connection strings
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com
DNNCovered.com - Your Offshore Dotnetnuke Partner
Dnncovered.com is the only Dotnetnuke offshore outsourcing center specializes in DNN skinning and module development with lowest pricing and quality service. Our staff is dedicated to websites based on DNN and our graphic designers are creative and imaginative well enough to provide customers the complete set of skinning solutions and packages
www.dnncovered.com
PointClick.Net DNN Solutions
DotNetNuke Hosting Platform for Business and personal use.
PointClick.Net Hosted Solutions

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP