i got the (User.identity.name) blues :(

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: May 2008
Posts: 34
Reputation: ricksvoid is an unknown quantity at this point 
Solved Threads: 0
ricksvoid ricksvoid is offline Offline
Light Poster

i got the (User.identity.name) blues :(

 
0
  #1
Sep 3rd, 2009
What I want to do is get a users current login username, and pass it to an SQL query which will search a table and return all entries belonging to that person. Ive managed to pass the username onto a label when that person logs in.

  1.  
  2. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  3. Dim theUser = User.Identity.Name
  4. greeting.Text = "hello " & theUser.ToString()
  5. End Sub

I would like to take this a step further by allowing for a pageload event that automaticly querries a table and binds that information unto a datagrid. BTW... I am familiar with the sytax and logic involved with binding a set of records unto a datagrid control. What i am lacking is the knowlege to allow only information that pertains to the logged in user.

Please help,
Rick Pace
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,219
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 574
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: i got the (User.identity.name) blues :(

 
1
  #2
Sep 3rd, 2009
  1. Dim query As String = "Select * From someTable Where UserName = '" & theUser.ToString() & "'"
Last edited by sknake; Sep 3rd, 2009 at 4:07 pm.
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 34
Reputation: ricksvoid is an unknown quantity at this point 
Solved Threads: 0
ricksvoid ricksvoid is offline Offline
Light Poster

Re: i got the (User.identity.name) blues :(

 
0
  #3
Sep 3rd, 2009
Thanks, that totally worked. It seems i was missing the apostrophes.
ahhh sytax.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC