Re: Translating VB.NET-code into C#.NET + ASP.NET
From: Sjakie (Sjakie_at_discussions.microsoft.com)
Date: 08/09/04
- Next message: Tibo: "Dial incoming connections ICF rules"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: Is "about:blank" always "bad"?"
- In reply to: Mike Bright MSP: "Re: Translating VB.NET-code into C#.NET + ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 9 Aug 2004 03:55:01 -0700
This is the only error I get:
Cannot implicitly convert type 'System.Array' to 'string[]'
on line --> string[] roleListArray =
roleList.ToArray(typeof(string)); <--
"Mike Bright MSP" wrote:
> Sjakie, don't have a compiler to hand to check this but:
>
> protected void Application_AuthenticateRequest(Object sender, EventArgs e)
> {
> if(Request.IsAuthenticated)
> {
> SqlDataReader reader;
>
> reader =
> SqlHelper.ExecuteReader(connection_string,CommandType.StoredProcedure,"rolesForUser",new
> SqlParameter("@Username",User.Identity.Name));
>
> ArrayList roleList = new ArrayList();
>
> while(reader.Read())
> {
> roleList.Add(reader["Name"]);
> }
>
> string[] roleListArray = roleList.ToArray(typeof(string));
>
> HttpContext.Current.User = new
> GenericPrincipal(User.Identity,roleListArray);
> }
>
> }
>
> Mmm, as I said no compiler to hand, so if it doesnt compile post back, b.t.w
> this isn't really the place to post this, you should post this in the
> C# newsgroups.
>
> Regards
>
> Mike Bright MCP, MSP
>
> e:mike.bright@brightweb.co.uk
>
>
>
- Next message: Tibo: "Dial incoming connections ICF rules"
- Previous message: anonymous_at_discussions.microsoft.com: "Re: Is "about:blank" always "bad"?"
- In reply to: Mike Bright MSP: "Re: Translating VB.NET-code into C#.NET + ASP.NET"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|