Oh, of course. Sorry for missing that the LCID is explicitly unsigned in the
Add method :-).

You should be able to use Convert.ToUInt32 on the LCID property, instead of
trying to convert to ToString() representation of the Locale.

Cheers,
Joe.


On Wed, Jun 15, 2011 at 12:20 PM, Paul Noone <
paul.no...@ceosyd.catholic.edu.au> wrote:

> I tried using it directly first time round which is how I wound up stuck
> with messy conversions. J
>
>
>
> *Error  1*        The best overloaded method match for
> 'Microsoft.SharePoint.SPWebCollection.Add(string, string, string, uint,
> string, bool, bool)' has some invalid arguments
>
> *Error  2*        Argument '4': cannot convert from 'int' to 'uint'
>
>
>
> Regards,
>
> Paul
>
>
>
> --
>
> Online Developer/SharePoint Administrator,
> ICT Infrastructure Team
> *CEO Sydney*
>
>
>
> *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On
> Behalf Of *Joseph Clark
> *Sent:* Wednesday, 15 June 2011 12:15 PM
> *To:* ozMOSS
> *Subject:* Re: SPWebCollection Add Method
>
>
>
> SPWeb.Locale returns a 
> CultureInfo<http://msdn.microsoft.com/EN-US/library/kx54z3k7>object, so you 
> should be able to pass the
> LCID<http://msdn.microsoft.com/EN-US/library/system.globalization.cultureinfo.lcid>property
>  from this straight into the add method.
>
> eg:
>
> siteCollection.Add("foo", "foo", "bar",
> siteCollection.RootWeb.Locale.LCID);
>
>
> On Wed, Jun 15, 2011 at 12:10 PM, Paul Noone <
> paul.no...@ceosyd.catholic.edu.au> wrote:
>
> OK. Almost there using siteCollection.RootWeb.Locale but now I’m having
> trouble with converting the value.
>
>
>
> The following will build without error but just looks plain wrong. Does
> anyone know what type of field I’m dealing with?
>
>
>
> //Inherit LCID from parent
>
> string LCID = siteCollection.RootWeb.Locale.ToString();
>
> uint webLCID = Convert.ToUInt32(LCID);
>
>
>
> Regards,
>
> Paul
>
>
>
> --
>
> Online Developer/SharePoint Administrator,
> ICT Infrastructure Team
> *CEO Sydney*
>
>
>
> *From:* ozmoss-boun...@ozmoss.com [mailto:ozmoss-boun...@ozmoss.com] *On
> Behalf Of *Paul Noone
> *Sent:* Wednesday, 15 June 2011 11:13 AM
> *To:* ozMOSS (ozmoss@ozmoss.com)
> *Subject:* SPWebCollection Add Method
>
>
>
> Hi all,
>
>
>
> I’m trying to provision a subsite using this method and am stuck on the *
> nLCID* parameter.
>
>
>
> The API states a 32-bit GUID is required but I can’t find one! J
>
>
>
> I want to inherit from the parent Site which uses English-AU but am not
> sure if I’m getting it properly.
>
>
>
> Will the following work?
>
>
>
> if (currentPublishingSite.IsRoot)
>
> {
>
> using (SPSite siteCollection = new SPSite(SPContext.Current.Web.Url))
>
> {
>
> using (SPWeb web = siteCollection.OpenWeb())
>
> {
>
>                   //Inherit LCID from parent
>
>                   uint webLCID = SPSite.Language;
>
>                   // webUrl, Title, Description, LCID, Template,
> UniquePerms, bConvertIfThere
>
>                   using (SPWeb newSite = siteCollection.RootWeb.Webs.Add(
> "AboutUs", "About Us", "More information about this site.", webLCID,
> _siteTemplateNamePrefix, false, false))
>
>                   {
>
>                         // Perform additional customisations here
>
> }
>
>             }
>
>       }
>
> }
>
>
>
>
>
> Kind regards,
>
> Paul Noone
>
>
>
> ---------------------------------------------------
> Online Developer/SharePoint Administrator
>
> Infrastructure Team, ICT
> Catholic Education Office, Sydney
> p: (02) 9568 8461
>
> f: (02) 9568 8483
> e: paul.no...@ceosyd.catholic.edu.au
> w: http://www.ceosyd.catholic.edu.au/
>
>
>
>
> _______________________________________________
> ozmoss mailing list
> ozmoss@ozmoss.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
>
>
>
> _______________________________________________
> ozmoss mailing list
> ozmoss@ozmoss.com
> http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss
>
>
_______________________________________________
ozmoss mailing list
ozmoss@ozmoss.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozmoss

Reply via email to