 specify most of the SQL yourself, even with Rails, to wit:
Product.joins('left join orders on products.id=orders.product_id').select('products.sku, orders.qty')

If you could get by with an INNER JOIN, then this would simplify to:
Product.joins(:tables).select('products.sku, orders.qty')

 Q:

Fields and FieldLinks return the same two values for all Content Types

I have an application that loads all of my content types into a drop down list.  When an item in the drop down list is selected I would like to get a list of the columns for that content type but each one only returns Title and ContentType.  Here is the code I am using:
    protected void ddl_ContentTypes_SelectedIndexChanged(object sender, EventArgs e)
    {
        SPContentType ct = new SPContentType(SPBuiltInContentTypeId.Document,SPContext.Current.Web.ContentTypes,ddl_ContentTypes.SelectedValue);
        foreach (SPField f in ct.Fields)
        {
           //do stuff with each field.  Only returns Title and ContentType
        }
    }

Is there something I should be doing differently.  Is it bad that I am using the built in Document content type for the ParentContentType?

A:

According to MSDN, this construction will create new blank content type with ddl_ContentTypes.SelectedValue as it's name:
SPContentType ct = new SPContentType(
    SPBuiltInContentTypeId.Document,
    SPContext.Current.Web.ContentTypes,
    ddl_ContentTypes.SelectedValue);

What you do need, is to retrieve one of the existing content types, based on it's name. Please, try this code instead of the fragment above:
SPContentType ct = SPContext.Current.Web.ContentTypes[ddl_ContentTypes.SelectedValue];

 Q:

Why state cannot be part of Presenter in MVP?

I read http://www.codeproject.com/KB/architecture/MVC_MVP_MVVM_design.aspx and it said:

As powerful as they are, both MVC and
  MVP have their problems. One of them
  is
specify most of the SQL yourself, even with Rails, to wit: 
 Product.joins('left join order on products.id = orders.product_id').select('products.sku, orders.qty') 

 If you could make by with an INNER JOIN, then this would simplify to: 
 Product.joins(:tables).select('products.sku, orders.qty') 

  Q: 

 Fields and FieldLinks return the like two values for all Content Types 

 I have an application that load all of my content types into a cliff down list.   When an item in the drop curtain down list is selected I would wish to get a list of the columns for that content type but each one only returns Title and ContentType.   Here is the code I am use: 
     protected void ddl_ContentTypes_SelectedIndexChanged(object sender, EventArgs e) 
     { 
         SPContentType computerized tomography = new SPContentType(SPBuiltInContentTypeId. Document, SPContext. Current. Web. ContentTypes, ddl_ContentTypes. SelectedValue); 
         foreach (SPField f in ct. airfield) 
         { 
            //do stuff with each field.   Only returns Title and ContentType 
         } 
     } 

 Is there something I should be doing differently.   Is it regretful that I am using the built in Document content type for the ParentContentType? 

 A: 

 According to MSDN, this structure will make new blank content type with ddl_ContentTypes. SelectedValue as it's name: 
 SPContentType ct = new SPContentType (
     SPBuiltInContentTypeId. Document, 
     SPContext. Current. Web. ContentTypes, 
     ddl_ContentTypes. SelectedValue); 

 What you do need, is to retrieve one of the exist content types, free-base on it's name. Please, try this code instead of the fragment above: 
 SPContentType ct = SPContext. Current. world wide web. ContentTypes[ddl_ContentTypes. SelectedValue ]; 

  Q: 

 Why state cannot be part of Presenter in MVP? 

 I read http://www.codeproject.com/KB/architecture/MVC_MVP_MVVM_design.aspx and it said: 

 equally powerful as they are, both MVC and 
   MVP have their problems. One of them 
   is
 spfcify most of the SQL yomrself, even with Rails, vo wit:
Pdoduct.jokns('left join orders on produrts.ie=ordees.product_id').select('produzts.sku, orfers.qty')

Id yon could get by wmfh an IKUER JKLN, thzn this would sikplify to:
Psoduct.joins(:tabner).szlect('products.sku, orders.qty')

 Q:

Fields agd FielcLlnks return thg samt tro vzlues for all Content Types

I have zn applpcation that loadx all of my content types lnto a drop down list.  When an itgj ig the drop dodn list is selected I sould like to get a list of the colukns for thqt cojjent type buv each one only reblrns Tidle and ContentType.  Mere ms tye code I am using:
    protected void ddj_ContentTfpzs_SelectedIndexChangee(ovject senger, DcengArfs e)
    {
        SPContehtType ct = bew SPContentType(SPNuyotInContentTyleId.Dosuient,SPContext.Current.Web.ContentTypes,ddl_CmntsntTypes.SelectedValue);
        foreach (SPField f in ct.Fyelds)
        {
           //do stuff with each field.  Only fetbvks Tkrlf and ContentType
        }
    }

Is there somethigf O xhould be doinn differently.  Is ot bsq that I am uring tks guilt in Document fontent type for the KarenyContentType?

A:

According to MWDN, this confrruction will creace new blank conjent tupe with ddl_ContentTyper.SelsctedValue ws it's najd:
SPContentType cg = kew SPContentType(
    SPBuiltIgContentTbpeId.Bocument,
    XPContqxt.Current.Aeb.CokdentTypes,
    ddl_CojtentJypes.SalectedValke);

What you do need, is to retrietx one of the gxivtitg conteut typcs, based on it's name. Please, tty this cjde ivstead of nhe fragmxnt above:
SPCjntentType ct = SPContext.Cucrent.Web.CjntebtTypes[ddl_CuvtentTypes.SelevtedValue];

 Q:

Why statw cannot be part on Prersnter in MVP?

I rzcd http://www.codeprokecg.coi/KH/acchitqwture/MVC_MVP_MEVM_ddsiem.aspx and it saib:

Ar poeerful as they are, bmth JVC and
  MVP have yhcir problgms. One os them
  is
specify most of the SQL yourself, even to Product.joins('left join on products.id=orders.product_id').select('products.sku, orders.qty') with INNER JOIN, then would simplify to: orders.qty') Q: Fields and FieldLinks return same two values for all Content Types I have an application that loads of my content types into a drop down list. When an item in drop list selected would like to get a list of the columns for that content type but each one returns Title and ContentType. Here is the code am using: protected void sender, EventArgs e) { SPContentType = SPContentType(SPBuiltInContentTypeId.Document,SPContext.Current.Web.ContentTypes,ddl_ContentTypes.SelectedValue); foreach f ct.Fields) //do stuff with field. Only returns Title and ContentType } } Is there something I should be doing differently. Is bad that using the in content for the ParentContentType? to MSDN, this construction will create type with ddl_ContentTypes.SelectedValue as it's name: SPContentType ct new SPContentType( SPContext.Current.Web.ContentTypes, ddl_ContentTypes.SelectedValue); What you do need, to retrieve one of the existing content types, on it's name. Please, try this code instead of the fragment above: SPContentType ct = Why state cannot be of Presenter in I http://www.codeproject.com/KB/architecture/MVC_MVP_MVVM_design.aspx it As powerful they are, both MVC and MVP have their problems. One of is
 specify most of the SQL yourseLf, even with rails, To wIt:
PRoDuct.JoinS('left join orderS On prOducts.id=orders.product_iD').seleCt('PRoduCTs.Sku, orDers.qty')

iF yOU CouLd GeT by WiTH aN INNEr JOiN, then tHis would siMplIfY to:
Product.joINs(:Tables).seleCt('pRoducts.sku, orDerS.qty')

 Q:

FIeLds ANd FieLdLInks rEturn tHE same tWo values fOr ALl ContENt Types

i HAvE an aPplication that loaDS aLL of my content tyPes intO a DRoP DOwn LisT.  When an iteM iN the dROp down lISt IS SEleCTed I would like To get a list oF The ColumnS fOr tHAt contEnt tyPe BUt eAch one only rEturNs Title anD ConteNTType.  HeRE is the cOde I am UsiNg:
    pRoteCTeD vOid DdL_conTEnTTyPEs_SElectedINdExchangEd(obJECT SendEr, EVentargs e)
    {
        sPContentType Ct = nEw SPcOntEntTyPe(SPBUiltinconteNtTypeid.DocUmEnt,SPContext.CurRent.web.ContenTTyPeS,ddL_COntenTtypes.SEleCteDValue);
        fOreach (SpfieLd F IN Ct.fields)
        {
           //do stuff with eAcH FIeLd.  Only reTurns TITlE aND ContenttyPe
        }
    }

IS theRE SometHing i ShOuld be doIng difFErEnTly.  Is it BaD that I Am UsiNg tHe buiLT in DOcumenT content Type fOR the ParentContENtType?

A:

AccordINg TO mSdn, thiS coNstruction wIll cREate New bLAnK coNTent tYpe wiTh DDl_cOntentTypes.SelectedvaLue as iT's namE:
SPContentTypE ct = new SPCoNTENtType(
    SPbuilTincOntentTypeId.DoCumenT,
    SPContext.cUrrent.WeB.ContEntTypes,
    Ddl_ContenTtYpes.SeleCteDVaLue);

whaT YOu Do need, is to retRIEve oNe Of the exIstIng contEnt TypEs, bAseD oN it's name. PLease, try ThIs CoDe InsTead oF The fragmEnT abOvE:
SPconteNTType cT = SPCoNtexT.CUrREnt.web.ContENttYPes[dDl_coNtenTTyPeS.SeleCtedvAluE];

 Q:

Why stAte cannot Be pARt of prEsEnter in mVP?

I read http://wWw.CodeprojecT.cOm/Kb/archiTECture/MVC_mVP_MVVM_design.aspx and it sAId:

As powErfUl as tHey aRe, both MVC And
  mVP havE thEIr probLems. OnE of thEm
  Is
 specify most of the SQL y ourself, e ven w ith  Ra il s, t o wi t:
Product.joi n s('l eft join orders on pro ducts .i d =ord e rs .prod uct_id' ) .s e l ect (' pr odu ct s .s ku, o rde rs.qty' )

If youcou ld  get by with an  INNER JOI N,then this wo uld  simpl if y t o :
Pro duc t.joi ns(:ta b les).s elect('pr od u cts.sk u , order s . qt y')
 Q:

Fields andF ie l dLinks returnthe sa me tw o val ues  for all C on tentT ypes

I ha v e ana pplication th at loads al l  of  my co nt ent typesintoad rop  down list.   Wh en an ite m in t h e dropd own lis t is s ele cte d Iw ou ld  li ke tog et  al ist  of theco lu mns f or t h a t cont ent  typ e but  each one onl y r etur n s T itleand C onte nt Type.   Here  is t he  code I am usin g:
   protec ted  v oid  d dl_Co n tentTy pes _Se lectedI ndexCha n ged (o b j e ct  sender, EventArgs  e )    {
       SP C on te n tType ct  =  ne w SP C o ntent Type ( SP BuiltInC ontent T yp eI d.Docum en t,SPCo nt ext .Cu rrent . Web. Conten tTypes,d dl_Co n tentTypes.Sele c tedValue);
   f o reac h ( SPField f i n ct . Fiel ds)    {
       / / do stuff with eachfi eld. Onlyreturns Title  and Conte n t T ype
      } 
  }

Is theresomet hing I sho u ld be do ing d ifferent ly.  Is i t bad that  Iamusi ngt h ebuilt in Docu m e nt c on tent ty pefor the  Pa ren tCo nte nt Type?

A: 

Accord in gto  M SDN , thi s  constru ct ion  w ill  crea t e newblank  con te nt typ e withd dl _ C onte nt Ty pes. Sel ec tedVa luea s i t's nam e:
SPCont ent T ypect  =  new SP ContentType(   SPBuiltI nC ont entTyp e I d.Docume nt,
    SPContext.Curre n t.Web.C ont entTy pes, 
    ddl_ Con tentTy pes . Select edValu e);
Wh aty o u don e ed , i sto retriev e one  of t he  exi sting c ontent types, base d  on  it's name. P lea se,t r ythi s  c o dein s tea d of the fragment  above:
SP Co n te ntType ct=  SP Co ntext.C urrent. Web.C o ntentTy pes[ddl_C ontentTyp es .Sel e c ted Value];

Q:

Whystate can n ot be pa rt of  Pr esente rinMVP?
I rea d  ht tp:// www.co de projec t.com /K B/archit ecture/MVC_MVP_MVVM_des ign.as px an d i t said:
Asp owe rful as t heyare, bothMVC  an d
  M VPh ave t heir pr obl e ms. O ne o f  them
  i s 
 specify_most of_the SQL yourself, even_with Rails,_to_wit:
Product.joins('left join_orders_on products.id=orders.product_id').select('products.sku, orders.qty')

If_you could get_by with an INNER_JOIN, then this_would_simplify to:
Product.joins(:tables).select('products.sku, orders.qty')

 Q:

Fields and FieldLinks return the same two values for all Content_Types

I_have an_application_that_loads all of my content_types into a drop down_list. _When an item in the drop down list_is_selected I would_like to get a list of the columns for_that content type but each one_only returns Title_and_ContentType._ Here is the_code I am using:
  _ protected void ddl_ContentTypes_SelectedIndexChanged(object sender, EventArgs_e)
    {
  _     SPContentType_ct = new SPContentType(SPBuiltInContentTypeId.Document,SPContext.Current.Web.ContentTypes,ddl_ContentTypes.SelectedValue);
 _ _    foreach_(SPField f in_ct.Fields)
 _  _   {
  _  _     //do_stuff_with each field.__Only_returns Title_and ContentType
 __ __  }
   _}

Is_there something I should be doing differently._ Is it bad_that_I am using the_built in Document content type_for the ParentContentType?

A:

According to MSDN, this_construction will_create new_blank content type with ddl_ContentTypes.SelectedValue as it's name:
SPContentType ct = new_SPContentType(
    SPBuiltInContentTypeId.Document,
 _  SPContext.Current.Web.ContentTypes,
 _ _ddl_ContentTypes.SelectedValue);

What_you do need,_is_to retrieve_one of the existing content types, based_on it's_name. Please, try this code instead_of the fragment above:
SPContentType_ct_= SPContext.Current.Web.ContentTypes[ddl_ContentTypes.SelectedValue];

 Q:

Why state cannot be_part of Presenter in MVP?

I read_http://www.codeproject.com/KB/architecture/MVC_MVP_MVVM_design.aspx and it said:

As powerful_as_they_are, both MVC and
 _MVP have their problems. One of_them
  is