473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

tie membership login to my table?

I need to have users login using the ASP.NET sqlprovider but then would like
to direct them to a page based on some info in a separate table. Is there
code to generate the strange userid field in the membership table so I can
assign the userid to my table column and then search for my table row using
this user id?

Any other suggestions (besides writing a custom provider which I haven't the
time for) on how to achieve this linkage?

Thanks much
Jul 11 '06 #1
3 3163
There's a built-in view (vw_aspnet_Users ) where you can get the UserId by
passing the username (which you have from the loginname control).

Here's the idea:

<%@ Page Language="VB" %>
<%@ import namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the UserID from ASPNET users database</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
<asp:listbox id="ListBox1" runat="server"
datasourceid="SqlDataSource1" datatextfield="Uid"></asp:listbox></p>
<asp:sqldatasource id="SqlDataSource1" runat="server"
connectionstring="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
selectcommand="SELECT UserId AS Uid FROM vw_aspnet_Users WHERE (UserName =
'kencox')"></asp:sqldatasource>
&nbsp;</div>
</form>
</body>
</html>
<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename=&quot;profile site\App_Data\ASPNETDB.MDF&quot;;Integrated
Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Let us know if this helps?

(BTW, I wrote the Profile and Membership chapters for ASP.NET 2.0 All-In-One
Desk Reference For Dummies
http://www.wiley.com/WileyCDA/WileyT...471785989.html )
Ken
Microsoft MVP [ASP.NET]
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
>I need to have users login using the ASP.NET sqlprovider but then would
like
to direct them to a page based on some info in a separate table. Is there
code to generate the strange userid field in the membership table so I can
assign the userid to my table column and then search for my table row
using
this user id?

Any other suggestions (besides writing a custom provider which I haven't
the
time for) on how to achieve this linkage?

Thanks much

Jul 11 '06 #2
Ken, thanks much, this is just the ticket I was looking for!

"Ken Cox [Microsoft MVP]" wrote:
There's a built-in view (vw_aspnet_Users ) where you can get the UserId by
passing the username (which you have from the loginname control).

Here's the idea:

<%@ Page Language="VB" %>
<%@ import namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the UserID from ASPNET users database</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
<asp:listbox id="ListBox1" runat="server"
datasourceid="SqlDataSource1" datatextfield="Uid"></asp:listbox></p>
<asp:sqldatasource id="SqlDataSource1" runat="server"
connectionstring="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
selectcommand="SELECT UserId AS Uid FROM vw_aspnet_Users WHERE (UserName =
'kencox')"></asp:sqldatasource>
</div>
</form>
</body>
</html>
<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename="profilesite\ App_Data\ASPNETDB.MDF";Integrated
Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Let us know if this helps?

(BTW, I wrote the Profile and Membership chapters for ASP.NET 2.0 All-In-One
Desk Reference For Dummies
http://www.wiley.com/WileyCDA/WileyT...471785989.html )
Ken
Microsoft MVP [ASP.NET]
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:41**********************************@microsof t.com...
I need to have users login using the ASP.NET sqlprovider but then would
like
to direct them to a page based on some info in a separate table. Is there
code to generate the strange userid field in the membership table so I can
assign the userid to my table column and then search for my table row
using
this user id?

Any other suggestions (besides writing a custom provider which I haven't
the
time for) on how to achieve this linkage?

Thanks much


Jul 13 '06 #3
Thanks for letting us know it worked!

"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:A1**********************************@microsof t.com...
Ken, thanks much, this is just the ticket I was looking for!

"Ken Cox [Microsoft MVP]" wrote:
>There's a built-in view (vw_aspnet_Users ) where you can get the UserId
by
passing the username (which you have from the loginname control).

Here's the idea:

<%@ Page Language="VB" %>
<%@ import namespace="System.Data" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the UserID from ASPNET users database</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<p>
<asp:listbox id="ListBox1" runat="server"
datasourceid="SqlDataSource1" datatextfield="Uid"></asp:listbox></p>
<asp:sqldatasource id="SqlDataSource1" runat="server"
connectionstring="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
selectcommand="SELECT UserId AS Uid FROM vw_aspnet_Users WHERE (UserName
=
'kencox')"></asp:sqldatasource>
</div>
</form>
</body>
</html>
<connectionStrings>
<add name="ASPNETDBConnectionString" connectionString="Data
Source=.\SQLEXPRESS;AttachDbFilename="profilesite \App_Data\ASPNETDB.MDF";Integrated
Security=True;Connect Timeout=30;User Instance=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

Let us know if this helps?

(BTW, I wrote the Profile and Membership chapters for ASP.NET 2.0
All-In-One
Desk Reference For Dummies
http://www.wiley.com/WileyCDA/WileyT...471785989.html )
Ken
Microsoft MVP [ASP.NET]
"Dabbler" <Da*****@discussions.microsoft.comwrote in message
news:41**********************************@microso ft.com...
>I need to have users login using the ASP.NET sqlprovider but then would
like
to direct them to a page based on some info in a separate table. Is
there
code to generate the strange userid field in the membership table so I
can
assign the userid to my table column and then search for my table row
using
this user id?

Any other suggestions (besides writing a custom provider which I
haven't
the
time for) on how to achieve this linkage?

Thanks much



Jul 13 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ad | last post by:
I have create a custom membership provider. The common usage of custom membership is set it as default Membership Provider win web.config, and use login controls with it. How can I use custom...
9
by: Paul Keegstra | last post by:
Hi, I am currently working on an asp.net 2.0 web site that is a replacement of a classic asp web site. The current web site uses a Commerce Server 2002 database for storing user information. ...
0
by: chris | last post by:
I've been thinking about adding to my asp.net 2.0 web project (ecommerce) the use of the membership and login control capability. I've read a lot but still don't quite understand the practical use....
2
by: brown | last post by:
Is it possible to access the authenticated user data using the Membership and MembershipUser classes from an asp.net 2.0 project that doesn't contain the login controls? For example, one project...
0
by: Jay Pondy | last post by:
I added a Company field to the aspNet_Users table and then followed along with the MSDN docs on How to Implement a Custom Membership User by creating my inherited class from the...
1
by: Rusty Hill | last post by:
I am creating a web app to be shared amongst companies. Each user's credentials will be in the common ASP.NET membership database. Each company will have their own data base. I need to be able...
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
3
by: dm3281 | last post by:
Hello -- I need to write an ASP.NET 2.0 application for our clients to use to login and verify file transmissions. Each client will need their own logon, in addition to a way to assign each...
1
by: Jeff | last post by:
Hey ASP.NET 2.0 At work my boss have given me the task of developing a new website. Users will be able to register at the website and gain exclusive access to some information etc... Some...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.