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

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0easy way to get DBO and qualifiereasy way to get DBO and qualifier
Previous
 
Next
New Post
10/30/2006 2:17 PM
 
Is there an easy way to get the DBO and qualifier yet in DNN 4.X? Seems like it should be under DotNetNuke.Common by now... at the moment I have two functions that get these fine, but it's just rather messy.

Jason Honingford - Web & Software Developer
www.PortVista.com
 
New Post
10/30/2006 5:08 PM
 

How about this?

DotNetNuke.Framework.Providers.ProviderConfiguration _providerConfiguration = DotNetNuke.Framework.Providers.ProviderConfiguration.GetProviderConfiguration("data");

DotNetNuke.Framework.Providers.Provider objProvider = ((DotNetNuke.Framework.Providers.Provider)(_providerConfiguration.Providers[_providerConfiguration.DefaultProvider]));

_owner = objProvider.Attributes["databaseOwner"];

_prefix = objProvider.Attributes["objectQualifier"];

 

Good Luck,

Mike

 
New Post
10/31/2006 11:24 AM
 
Seems you've confirmed this is the only way. lol! This is what I use...
Edit: added the DBO function here

Public Shared Function getDBO() As String
            Dim _providerConfiguration As DotNetNuke.Framework.Providers.ProviderConfiguration = DotNetNuke.Framework.Providers.ProviderConfiguration.GetProviderConfiguration("data")

            Dim objProvider As DotNetNuke.Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), DotNetNuke.Framework.Providers.Provider)

            Dim _dbo As String = objProvider.Attributes("databaseOwner")

            If _dbo <> "" And _dbo.EndsWith(".") = False Then
                _dbo += "."
            End If
            getDBO = _dbo
End Function



Public Shared Function getQualifier() As String

            Dim _providerConfiguration As DotNetNuke.Framework.Providers.ProviderConfiguration = DotNetNuke.Framework.Providers.ProviderConfiguration.GetProviderConfiguration("data")

            Dim objProvider As DotNetNuke.Framework.Providers.Provider = CType(_providerConfiguration.Providers(_providerConfiguration.DefaultProvider), DotNetNuke.Framework.Providers.Provider)

            Dim _objectQualifier As String = objProvider.Attributes("objectQualifier")

            If _objectQualifier <> "" And _objectQualifier.EndsWith("_") = False Then
                _objectQualifier += "_"
            End If
            getQualifier = getDBO() & _objectQualifier
      
 End Function

Jason Honingford - Web & Software Developer
www.PortVista.com
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0easy way to get DBO and qualifiereasy way to get DBO and qualifier


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