in

SharePoint University

Clean slate. Nothing but SharePoint.
Go, SharePoint!

Who Is Online Web Part MOSS2007

Last post 07-07-2008 9:34 AM by skillmaster. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-01-2008 10:43 AM

    Who Is Online Web Part MOSS2007

    Hello,

    I am using C# vs2005 and sql express 2005 and I want to be able to make a web part that will show all the users that are currently online. I found a tutorial for it here:http://blogs.sqlxml.org/bryantlikes/articles/592.aspx but the forum has been dead for some time now. When I upload the web part I get an error stating "Keyword not supported: 'userid'" so at first I changed only my sql connection to say User Id but then  I changed each instance of the word and I am still getting the error. I have deleted the web part and uploaded it again from scratch and I am still seeing the error I am not sure if it has to do with the sql code or if sharepoint is caching that web part somewhere. If anyone is able to help me figure out what changes I need to make to the sql query or if its just something in sharepoint I greatly appreciate it. 

  • 07-01-2008 3:47 PM In reply to

    Re: Who Is Online Web Part MOSS2007

    I fixed my caching problem but I do have a question about the Hit_add after alter proc but that is more of a sql question however if someone could help me or if this does have to do with sharepoint I would like to know what the updated syntax for it is.

    create table ActiveUsers (
    UserID varchar(50) not null,
    LastHit datetime not null,
    LastUrl varchar(256) not null,
    constraint PK_ActiveSessions primary key clustered
    (
      UserID
    )
    )
    go
    alter proc Hit_Add
    (
    @Url varchar(256),
    @UserID varchar(50)
    )
    as
    -- this needs to be changed to the userID
    -- that your site runs as
    if (@UserID = 'DOMAIN\PROCESSID') return
    insert into Hits values
    (@Url, @UserID, getdate())
    delete ActiveUsers
    where UserID = @UserID
      or datediff(mi, LastHit, getdate()) > 30 -- minutes
    insert into ActiveUsers values
    (@UserID, getdate(), @Url)
    go
    create proc ActiveUsers_Get
    as
    select UserID, LastHit, LastUrl, datediff(mi, LastHit, getdate()) Age
    from ActiveUsers

    go

  • 07-07-2008 9:34 AM In reply to

    Re: Who Is Online Web Part MOSS2007

     there is a standard web part called SITE USERS

     

    i think that works. not tried it though

Page 1 of 1 (3 items)

Need SharePoint Training? Attend a SharePoint Bootcamp!
Forum content (c) original posters. Everything else (c) 2008 SharePoint Experts, Inc.