473,659 Members | 2,591 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Finding Email address in a Profile

I just started using The Login Objects and the CreateUserWizar d creates a
number of fields including Email address and i cant figure out how to
reference it: intellisense tells me that Profile.Usernam e is available, as
are all of my customised fieldnames - but where would i find the Email
Address?? All i want to do is assign the email address of the logged in user
to a string

Regards

Owen
Aug 24 '06 #1
1 1412
Hi Owen,

I think you'll find the email address is stored in a different place in the
database. You can get at it using one of the built-in views.

Here's some code that might get you pointed in the right direction. It feels
like a hack, so please post any improvements? See the inline comments for
details.

Let us know if this helps?

Ken
Microsoft MVP [ASP.NET[

<%@ Page Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">

<script runat="server">
Protected Sub Page_Load _
(ByVal sender As Object, _
ByVal e As System.EventArg s)
If Not IsPostBack Then
' By Ken Cox [Microsoft MVP]
' August 24, 2006
' Please improve on this hack! --kc
' Declare the dataview, sqldatasource
' and connection
Dim dv As New Data.DataView
Dim sqldsrc As New SqlDataSource
Dim connectionStrin gs As _
ConnectionStrin gSettingsCollec tion = _
System.Web.Conf iguration. _
WebConfiguratio nManager.Connec tionStrings
' Set the select command to use the built-in view
' and narrow the view down to the username
sqldsrc.SelectC ommand = "SELECT Email FROM " & _
"vw_aspnet_Memb ershipUsers WHERE (UserName = 'kencox')"
' Make sure we are treating it as a text
' query rather than as a stored procedure
sqldsrc.SelectC ommandType = SqlDataSourceCo mmandType.Text
' Tell the sqldatasource to return a dataset or datatable
sqldsrc.DataSou rceMode = SqlDataSourceMo de.DataSet
' Set the ID for good form
sqldsrc.ID = "sqldatasource1 "
' Fetch the connection string from the web.config
sqldsrc.Connect ionString = connectionStrin gs.Item _
("ASPNETDBConne ctionString").C onnectionString
' Get the retrieved data into the dataview by
' calling the Select method with no arguments
dv = sqldsrc.Select( DataSourceSelec tArguments.Empt y)
' Put the retrieved value from the "email" column
' into the label
Label1.Text = dv.Table.Defaul tView(0).Item(" email")
End If
End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Get the email address of a Membership row</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<div>
<p>
&nbsp;<asp:labe l id="Label1"
runat="server"> </asp:label></p>
&nbsp;</div>
</div>
</form>
</body>
</html>

"Owen Richardson" <Ow************ @discussions.mi crosoft.comwrot e in
message news:B5******** *************** ***********@mic rosoft.com...
>I just started using The Login Objects and the CreateUserWizar d creates a
number of fields including Email address and i cant figure out how to
reference it: intellisense tells me that Profile.Usernam e is available, as
are all of my customised fieldnames - but where would i find the Email
Address?? All i want to do is assign the email address of the logged in
user
to a string

Regards

Owen

Aug 24 '06 #2

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

Similar topics

11
2196
by: Picture Dots | last post by:
Ok - I want to check a string for @ in it (Im checking to see if a string that should contain an email holds a @ ) How would I go about this? preg_match? ereg? strstr?Examples? Also - how would I find any non alpha numeric characters in a string so I can give the user an error message. I dont want any characters besides alpha-numeric in the strings.
5
1710
by: cfoley1970 | last post by:
I have an online directory of alumni from a high school that runs PHP with a MySql backend containing contact info, email addresses, etc. Some of the alumni have begun to complain about receiving spam to their accounts, some of the spam saying that they "know" them from this site. I've also had alumni that have created email accounts to specifically use just for this site, and they've started getting spam as well. I "thought" I thought of...
1
4355
by: Dhruv | last post by:
1. I'm trying to get the notifications working on the scheduled jobs. I want to email me when the job fails. I created an operator (dmalhotr) and given me as the email address. Here is the error what I'm getting when I'm pressing the test button to email myself in properties dmalhotr operator (hope that makes sense). Error 22022: sqlserveragent error: the sqlserveragent mail session is not running; check the mail profile and/or the...
3
5947
by: Chuck Farah | last post by:
I am unsuccessfullly trying to display an outlook email from a vb web forms (.net) outlook 2002 #1. is it possible to use outlook client email from a web form using the outlook object model within vb .net for web forms? #2. If not what is recommended (SMTP has problems if the address are not correct). I also have used the Mailto: but am having problems passing the body with formating
2
3284
by: FR3AK | last post by:
Hi. does anyone have any idea of how to find the mac address of a remote networking device? I've worked with WMI and it works fine as long as the target machine is a Windows computer, however, i want to return the MAC address of ANY IP device on my network. right now, i have a totally inefficient way to return a mac address, but it's only by dropping to a command prompt and executing the ARP command (all within code....it's not as...
12
1411
by: Amir Ghezelbash | last post by:
Hello every body I had a question I am involved in a project where I need to verify the user's email address by sending them an email and asking them to click on a link. now I have done this but my link is human readable(example validator.aspx?address="blah@blah.com") so any user can just type in their email address into that link and it will validate it for them... now what I want to do is to encrypt this email but most of the...
4
1916
by: Mike | last post by:
Hi all, In my recent ASP.NET 2.0 appl, I need to verify that the supplied email address is valid or not. So, here's my situation: - In my <profilearea, I created <isVerifiedproperty. - Suppose a new user has been created. I set the profile.isverified to false. OnCreatedUser event I'll send him an email (to the supplied email address) to verify their email address with a link in it to an ASPX page that'll do the verification, e.g:...
8
7277
by: shapper | last post by:
Hello, I am trying to send an email using Asp.Net 2.0. I am getting the following error: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: No such user here at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify,
8
2908
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of Submit it would send email. But then I wanted to give a user an opportunity to go back and edit the entries if incorrect before submitting. I separted the codes into two pages. On the second page when Submit button is clicked it should send email. But...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8339
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8535
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4338
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.