Roles.GetRolesForUser(UserName) returning zero-dimension array

Discussion in 'ASP .Net Security' started by JaiPrakash Sharma, Jan 30, 2008.

  1. Hi,

    i am facing problem with Roles.GetRolesForUser(UserName).

    When i run application on my machine the Method returning zero-dimension
    array, Insted of When i run the same application on my friend's machine. it
    returns value in array.
    For the application we are using the SQL 2005 database located on my
    friend's machine.

    I am doing like this:
    Dim strarray() As String
    Dim result As Integer
    strarray = Roles.GetRolesForUser(Me.Context.User.Identity.Name)


    Here i am getting strarray zero-dimension.

    Even i had run the exe called "aspnet_regsql.exe" for same data schema on
    both machines.

    If anyone help me out this thing.

    Regards,
    JaiPrakash Sharma
    JaiPrakash Sharma, Jan 30, 2008
    #1
    1. Advertising

  2. By default SQLServer2005 does not allow remote connections; please verify
    that you have enabled remote connections on your firends machine

    http://support.microsoft.com/default.aspx/kb/914277


    --
    Misbah Arefin



    "JaiPrakash Sharma" wrote:

    > Hi,
    >
    > i am facing problem with Roles.GetRolesForUser(UserName).
    >
    > When i run application on my machine the Method returning zero-dimension
    > array, Insted of When i run the same application on my friend's machine. it
    > returns value in array.
    > For the application we are using the SQL 2005 database located on my
    > friend's machine.
    >
    > I am doing like this:
    > Dim strarray() As String
    > Dim result As Integer
    > strarray = Roles.GetRolesForUser(Me.Context.User.Identity.Name)
    >
    >
    > Here i am getting strarray zero-dimension.
    >
    > Even i had run the exe called "aspnet_regsql.exe" for same data schema on
    > both machines.
    >
    > If anyone help me out this thing.
    >
    > Regards,
    > JaiPrakash Sharma
    >
    Misbah Arefin, Feb 4, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QmVuIFIu?=

    Roles.IsUserInRole maps call to GetRolesForUser... Why?

    =?Utf-8?B?QmVuIFIu?=, Mar 20, 2006, in forum: ASP .Net
    Replies:
    7
    Views:
    886
    Steven Cheng[MSFT]
    Mar 24, 2006
  2. Nathan Sokalski
    Replies:
    2
    Views:
    465
    Nathan Sokalski
    Aug 5, 2008
  3. Nathan Sokalski
    Replies:
    2
    Views:
    1,585
    Nathan Sokalski
    Aug 9, 2008
  4. Nathan Sokalski
    Replies:
    2
    Views:
    989
    Nathan Sokalski
    Aug 5, 2008
  5. Nathan Sokalski
    Replies:
    2
    Views:
    1,318
    Nathan Sokalski
    Aug 9, 2008
Loading...

Share This Page