User Profile Management - Using Identity Primary Key with Custom Profile

This is Interesting: Free IT Magazines  
Home > Archive > User Profile Management > July 2004 > Using Identity Primary Key with Custom Profile





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Using Identity Primary Key with Custom Profile
Jason Sirota

2004-07-26, 5:53 pm

I would like to create a custom profile called "UserMarkets". This
custom profile would basically emulate a "many-to-many" join table, as
each user could belong to multiple markets and each market has many
users. The table is structured like this:

usermarket_id
user_guid (string)
market_id (int)
date_created
date_last_changed

I would like usermarket_id to be an integer so that the multivalue
field in the userobject isn't too long, and I would like that integer
to be assigned by SQL Server Identity. Is there anyway to call
"CreateProfile" from the ProfileSystem object without passing in a
primary key?

Thanks!
Jason
David Hargis [MSFT]

2004-07-30, 5:49 pm

Hello Jason,

I haven't had time to research this, but wanted to ping you with some
ideas. I'm not aware of any profile implementation that has a many-to-many
relationship, but this should be possible. You should know that the
profile primary key does not necessarially need to be a SQL primary key.
You should be able to use any integer / string column as your primary key
for the join profile and populate it with a random integer or guid; just to
give a unique key into the table. I don't believe you can create a profile
without specifying the primary key.

As for retrieving the users belonging to a market / markets a user belongs
to, you may need to use the csoledbprovider directly (through ADO /
ADO.NET) to get this information. I will need to try creating my own
implementation to know if there is any way to get the set of associated
profiles through the profile service.

Hope this helps,
David

--------------------
From: jasonsirota@gmail.com (Jason Sirota)
Newsgroups: microsoft.public.commerceserver.userprofilemgt
Subject: Using Identity Primary Key with Custom Profile
Date: 26 Jul 2004 14:24:44 -0700
Organization: http://groups.google.com
Lines: 19
Message-ID: <12e66dac.0407261324.47faca26@posting.google.com>
NNTP-Posting-Host: 216.103.134.129
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1090877085 6385 127.0.0.1 (26 Jul 2004 21:24:45
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 26 Jul 2004 21:24:45 +0000 (UTC)
Path:
cpmsftngxa10.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP0
8.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!fr.ip.ndsoftware.net!proxad
.net!postnews2.google.com!not-for-mail
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.userprofilemgt:3078
X-Tomcat-NG: microsoft.public.commerceserver.userprofilemgt

I would like to create a custom profile called "UserMarkets". This
custom profile would basically emulate a "many-to-many" join table, as
each user could belong to multiple markets and each market has many
users. The table is structured like this:

usermarket_id
user_guid (string)
market_id (int)
date_created
date_last_changed

I would like usermarket_id to be an integer so that the multivalue
field in the userobject isn't too long, and I would like that integer
to be assigned by SQL Server Identity. Is there anyway to call
"CreateProfile" from the ProfileSystem object without passing in a
primary key?

Thanks!
Jason


This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com