SIGN UP MEMBER LOGIN:    
ARTICLE

How to connect to Profile Database of Commerce Server 2009

Posted by Prasham Sabadra Articles | ADO.NET in C# January 11, 2010
Here in this article I will explain detail steps to connect the profile database.
Reader Level:

For one of my application, I required to get list of all the stores stored in StoreObject table in Profiles database. Here in this blog I will explain detail steps to connect the profile database

To connect to database, connection string will be retrieved using the CommerceResourceCollection object as

CommerceResourceCollection rescol = new CommerceResourceCollection (Commercecontext.Current.SiteName);

Here, Commerce Server .NET Application Framework creates the CommerceContext objects as a part of the processing for every page in commerce site.

Commercecontext.Current.SiteName returns the current site name. Available in namespace "Microsoft.CommerceServer.Runtime"

CommerceResourceCollection: This class represents the collection of the resources for the provided site. This class is available in Microsoft.CommerceServer.Runtime.Configuration namespace.

There are two types of resources

  • Global Resources : These resources are shared across commerce server sites
  • Site Resources: These resources are not shared across the sites.

Get the connection string to the profile data store as follows

String connStr = rescol ["Biz Data Service"] ["s_BizDataStoreConnectionString"].ToString( ) ;

Here, "Biz Data Service": - The name of resource to be retrieve

"s_BizDataStoreConnectionString": - The name of property whose value is retrieved

You can see those connection string values from Commerce Server Manager Tool.

Commerce Server Manager >> Global Resources >> Profiles

Once we get the connection string we can connect to the Profile Database and get the data from any table.

Login to add your contents and source code to this article
share this article :
post comment
 
Team Foundation Server Hosting
Become a Sponsor
PREMIUM SPONSORS
  • ceTE software specializes in components for dynamic PDF generation and manipulation. The DynamicPDF™ product line allows you to dynamically generate PDF documents, merge PDF documents and new content to existing PDF documents from within your applications.
    Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
Nevron Gauge for SharePoint
Become a Sponsor