.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

current logged in user and password using a TSQL

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :Sql Server

Dear frnds,



Is there is any way to get current logged in user and password using a TSQL?  (SQL MODE)





Sajid P K

View Complete Post

More Related Resource Links

How to get current logged user name using javascript ?

HelloI am using moss with FBA. I got following javascript to get current user login name. It is displaying curent username properly if user is belong to owner group. But whne I logged with another username who is part of member group(Contribute role), it is not displaying name. Please let me know what I am missing?In following javascript I alerted userId, it is coming in both the case <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_Core.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_Lists.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_UserGroup.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_UserProfile.js"></script> <script language="JavaScript"> var curTitle = null; alert(_spUserId); function getCurrentUserName() { var curUserName = null; var lists = new SPAPI_Lists('') var items = lists.getListItems( 'User Information List', '', '<Query><Where><Eq><FieldRef Name="ID"/><Value Type="Counter">' + _spUserId + '</Value></Eq></Where></Query>', // query '<

how to get current logged in user in sharepoint

hi im trying to get current logged in user from sharepoint site. All im getting is domain/administrator. I tried following. SPUser and delegation with elevated privilege. they are also not working for me. following is the code im working. spsite site = new spsite("some site")  spweb web = site.openweb() then im using spuser object to get the user. i went to the following link but it seems that guy was also not able to do this.... http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4101e616-db5d-4504-ad16-169ff62269fb/   any idea... thanks Aqi

search current logged in user's information in sharepoin list


hi guys,

in order to prepopulate some user information, i used query to search the sharepoint list. my question is how to search loggin user's info in the list.

i used following testing query function. it works fine. however, it can only search specific text, cannot be changed according different user.

SPList IsExist;
                    IsExist = SPContext.Current.Web.Lists["somelist"];
                    SPQuery query = new SPQuery();
                    query.Query = @"
                                    <FieldRef Name='First_x0020_Name'/>
                                    <Value Type='Text'>XXX</Value> 
                                    <FieldRef Name='Last_x0020_Name'/>
                                    <Value Type='Text'>XXX</Value> 
                    SPListItemCollection found = IsExist.GetItems(query);

how to get current logged in user for sharepoint site


Hi ,

im not able to get the current logged in user for sharepoint site.

for example--if i logged in with "abc" in my system and  logged in with "pqr" on sharepoint site.
then "oWeb.CurrentUser " return the "abc" .
 but as per me..i want pqr--bez im logged in to share point site with "pqr" user.

Id of the Current Logged In user



i have created a login structure  through  ASP.net Website Administration Tool


now to knw the current user Logged in




String uname = HttpContext.Current.User.Identity.Name;




Getting current logged in user name


I thought this would be a simple task as I am trying to get the current logged in domain user name.  I have the following:

Dim currentUser As String = HttpContext.Current.User.Identity.Name.ToString

but it ALWAYS returns nothing ""

Is there some configuration in the ASP that I have to do first?

Thanks for the information 

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

logged in user data


I'm using the defualt membership provider, i created a table and used the gridview on the logged in user page to show his information such as address e-mail phone zip code etc,, how can i do this without writing a code?

I am new to asp.net  i need simple help please?

Users getting logged out because HttpContext.Current is null


We've  been trying to fix this one for a couple years, and I'm just out of ideas, so any help is really appreciated!

We've got a fairly large, complex web application that uses Forms Authentication to authenticate users.  Throughout the application we store and retrieve information about users in the Session object, and in some cases in cookies.  In a couple places we check for the existence of the context, and if it's null we send the user back to the login page to re-establish the session. 

Just a quick run-down of this web app: C#, .NET 3.5, IIS 6, ASP.NET State Service to manage session

As for the session timer, we use our own home-grown timer, which is basically a client-side timer, which is backed up by a check to the SQL database to see when their last activity was.  This seems to work well for us.  It's not perfect, but it allows us to notify the user before the session times out, and allows us to be certain we're not logging a user out before their 60 minutes of inactivity is up.

What's happening is that certain users are being logged out after just a few minutes.  We've eliminated the timer as a cause and believe what's happening is the HttpContext.Current is null, so the user is logged out.  We do not know why the HttpContext.Current is null, and I underst

help needed: Ldap User authentication using userDN and password



Is it possible to authenticate a user using userDN and password? If so, then tell me the syntax.So far i have tried to authenticate using username and password from my c# code using directoryentry which takes the parameters like domainname,username and password. But i need to authenticate using Userdn and password.

Fetching the Currently Logged in user Email


Hey Frnds,

I am using the System.DirectoryServices.UserPrincipal.Current.EmailAddress to fetch the Currently logged in users email from AD.

If  debug my sol am getting the Exact mail id of that Particular user for ex:john@in.domain.com.

If i host My Application on iis

And Access my App am getting some other Email id instead of the john@in.domain.com.

I have changed the Application Pool identity to NetWorkService.

Can any one tell what could be wrong




Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

create current user filter in sharepoint designer or wss3

hi, how can i create a current user filter in sharepoint designer?

The name 'User' does not exist in the current context.


Hey guys,

I've got a literal control to display the username of the user logged into our companies intranet system, originally I had a LoginName control but couldn't get strip to remove the domain from the username (as the format is domainname\username) so I'm trying it this way.

    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

        if (Parts.Length == 2)
            loginName.Text = Parts[1];
            loginName.Text = User.Identity.Name;


    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

How to make "UserId" equal to the "logged-in user" in vb code behind


I need to insert a declaration in the codebehind function below that will make the variable "UserId" equal to the "logged-in user". In what way do I need to change the code below (elsewhere in the project, I successfully make reference to basically the same code and make the UserId equal to logged-in user by using this handler expression inside an image control: ImageUrl ='<%# Eval("UserId","Image.aspx?UserId={0}")%>'...But in the case below, the function is not fired by this expression, but rather by CustomValidator). Thanks very much.


Sub ValidateImage(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)

        If Request.QueryString("UserId") IsNot Nothing Then
            ' Get the connection string from Web.config.

            Using conn As New SqlConnection(ConfigurationManager.ConnectionStrings("MyDatabaseConnectionString").ToString())
                ' Create a command object.

How To Check if user is already logged to another computer..???

By the way.,, I am new here.... I  am doing a little vb.net windows form project but connected with the internet ... question : how can I check if the user is already login to another computer..??   somebody here please.. ideas.. thanks..... : )    

How to determine if current SQL User is admin or owner?

I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend