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  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Iron Speed Designer is a software development tool for building database, reporting, and forms applications for .NET without hand-coding.
 


  Sponsors  

Meet Our Sponsors

Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


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
409 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.

 


BataviaSoft DotNetNuke Solutions
BataviaSoft offers custom DotNetNuke solutions especially for the European and the South East Asian market.
www.bataviasoft.com
Viva Portals, L.L.C.
Expert module development and graphic design.
www.continure.com
DNN Photo Gallery
DNN Photo Gallery is a truly unique photo management module released January 1st 2006. With DNN Photo Gallery you can REALLY integrate images into your existing portal and make them look like they were designed for your site.
DNN Photo Gallery

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