Kua: SPQuery tsis nrhiav Folders

Yav tas los lub limtiam uas kuv tau siv lub tswv yim no muaj "evolving" muab rau ib tug neeg uas siv cov BDC thiab cov SPQuery thiab khiav rau tej teeb meem siv SPQuery rau ib daim ntawv uas muaj folders. Ntxaib: cob "recursive" mus saib attribute rau cov lus nug.

Kuv scenario:

  • Hnub Monday, Upload ib daim ntawv thiab muab tej ntaub ntawv no meta.
  • Lub lim tiam li nram no, Kuv upload ib daim ntawv tshiab. Ntau yam ntawm cov ntaub ntawv meta no daim ntawv tus tshiab raws li daim ntawv kuv busy uploaded (uas peb hu tus "npaj ntaub ntawv").
  • Peb thiaj tau tsim lub Web site pab façade uas muab hauv BDC interface rau daim ntawv kom cov neeg siv tau yooj yim nrhiav ntawd hnub ib daim ntawv ntawm lub npe nrhiav.
  • Ib tug ncej tag BDC tej ntaub ntawv qhia tus neeg siv tus phooj ywg interface. (Qhov no yog ib feem ntawm kuv los kom siv BDC rau sab Lookup ntau tus phooj ywg).

Qhov kawg BDC façade kev siv ib cov lus nug li no ua rau lookup:

 // Siv U2U tuam mus pab generating qhov lus nug no CAML.
      oQuery.Query =
        "<Nyob qhov twg>";

      Yog hais tias (titleFilter.Length > 0)
        oQuery.Query  =
          "  <Thiab>";

      oQuery.Query  =
        "    <Thiab>" +
        "      <Geq>" +
        "        <FieldRef Name = yog muaj "DocumentId" />" +
        "        <Value yam = yog muaj "Text">" + minId + "</Tus nqi>" +
        "      </Geq>" +
        "      <Leq>" +
        "        <FieldRef Name = yog muaj "DocumentId" />" +
        "        <Value yam = yog muaj "Text">" + maxId + "</Tus nqi>" +
        "      </Leq>" +
        "    </Thiab>";

      Yog hais tias (titleFilter.Length > 0)
        oQuery.Query  =
          "    <Muaj>" +
          "      <FieldRef Name = yog muaj "Title" />" +
          "      <Value yam = yog muaj "Text">" + titleFilter + "</Tus nqi>" +
          "    </Muaj>" +
          "  </Thiab>";
      oQuery.Query  =
        "</Nyob qhov twg>";

Thaum pib txog theem ntawm kev loj hlob, qhov no ua haujlwm great. Txawm li cas los, peb nkag tau folders rau hauv cov directory yuav kom daws tau tej teeb meem no thiab mam li nco dheev, Kuv tus BDC picker tsis rov qab muaj ntsiab. Kuv tracked no mus ua tus Disease fact tias tus SPQuery yeej tsis rov muaj ntsiab. Peb siv folders los pub ntau yam ntaub ntawv uas muaj lub npe qub los yuav uploaded tab sis meta tej ntaub ntawv uas muaj neeg. Thaum cov ntaub ntawv yog uploaded, peb yuav tsim ib tug ntawv tais ceev tseg raws li daim ntawv teev khoom tus ID thiab mam li tsiv ntawv muaj (Kuv thiaj sau txog ntawd ntawm no; peb twb muaj mixed ntsuam cov kauj, tiam sis ntawm tus kheej, nws zoo zoo). Tus neeg siv tsis care txog folders thiab tiag, tsis tshua to taub tias muaj ntau yam folders. Peb muaj configured tag nrho cov kev views rau lub tsev qiv ntawv los qhia cov khoom s. folders.

Kuv ntaus cov teeb meem no ob zaug raws li cov kev siv evolved thiab solved nws txawv txhua sij hawm. Thawj thawj zaug, Kuv tsis yog siv tus neeg teb xov tooj CONTAINS rau cov lus nug. Tsis muaj ib tug neeg tsav tsheb CONTAINS, Kuv txawm yuav kom daws tau qhov teeb meem los ntawm specifying cov pom hauv lub SPQuery contructor. Tsis txhob siv lub neej ntawd constructor:

Splist.Update() oList = Web site.Teev["Cov ntaub ntawv"];

SPQuery oQuery = tshiab SPQuery();

Kuv txhais xwb ib constructor uas teev ib saib:

Splist.Update() oList = Web site.Teev["Cov ntaub ntawv"];

SPQuery oQuery = tshiab SPQuery(oList.Views["Cov ntawv"]);

Solved qhov teeb meem ntawd thiab yog tau txais kuv tau.

Ces kuv ntxiv hom kab mob tus neeg teb xov tooj CONTAINS ua tus ntse thiab raug dua. Nws puv tawm uas tus neeg teb xov tooj CONTAINS, thiaj li yuav paub kuv, tsis ua hauj lwm nrog rau cov saib tau ib yam nkaus li rau ib cov zauv GEQ / Tswv LEQ. Kuv tau ua ib co searching thiab kawm tias ViewAttributes cov lus nug yuav tsum muab teev cia rau cov "Recursive", raws li nyob rau hauv:

oQuery.ViewAttributes = "Tau = yog muaj"Recursive"";

Uas solved qhov teeb meem rau CONTAINS. qhov tseeb, qhov no kuj solved kuv yuavtsum nrhiav teebmeem thiab yog hais tias kuv yuav tsum teev cov recursive attribute thawj zaug, Kuv yuav tsis tau khiav mus rau hauv lub qhov teeb meem dua.

Tus fact SPQuery Saib kuas rau qee tus tswv xwb (GEQ/LEQ) thiab tsis yog lwm leej lwm tus (MUAJ), coupled nrog cov fact KPIs tsis zoo li mus ua hauj lwm txhua nrog rau nplaub tshev uas muaj ntaub ntawv qiv leads kuv ntseeg hais tias SPQuery muaj tej qhov teeb meem txog orthogonality.

Tsaug tshwj xeeb:

  • Tus zoo folks tom U2U thiab lawv cov lus nug cuab tam.
  • Michael Hoffer tus poj "kev kawm tau los ua" Blog ncej, lus thiab cov lus teb.

</kawg>

Subscribe rau kuv blog!

3 xav txog"Kua: SPQuery tsis nrhiav Folders

  1. Tsis muaj lub npe

    http://www.batteryfast.co.uk/asus/w3v.htm roj teeb w3v asus,
    http://www.batteryfast.co.uk/asus/w3000a.htm roj teeb w3000a asus,
    http://www.batteryfast.co.uk/asus/w3000.htm roj teeb w3000 asus,
    http://www.batteryfast.co.uk/asus/w3000v.htm roj teeb w3000v asus,
    http://www.batteryfast.co.uk/asus/a31-s5.htm roj teeb a31-s5 asus,
    http://www.batteryfast.co.uk/asus/a32-s5.htm roj teeb a32-s5 asus,
    http://www.batteryfast.co.uk/asus/s52n.htm roj teeb s52n asus,
    http://www.batteryfast.co.uk/asus/s5000.htm roj teeb s5000 asus,
    http://www.batteryfast.co.uk/asus/s5200n.htm roj teeb s5200n asus,
    http://www.batteryfast.co.uk/asus/s5n.htm roj teeb s5n asus,
    http://www.batteryfast.co.uk/asus/90-naa1b1000.htm roj teeb 90-naa1b1000 asus,
    http://www.batteryfast.co.uk/asus/s2691061.htm roj teeb s2691061 asus,
    http://www.batteryfast.co.uk/asus/a42-v6.htm asus a42-v6 roj teeb,
    http://www.batteryfast.co.uk/asus/a32-u5.htm roj teeb a32-u5 asus,
    http://www.batteryfast.co.uk/asus/u5f.htm roj teeb u5f asus,
    http://www.batteryfast.co.uk/asus/u5a.htm roj teeb u5a asus,
    http://www.batteryfast.co.uk/asus/u5f.htm roj teeb u5f asus,
    http://www.batteryfast.co.uk/asus/u5.htm roj teeb u5 asus,
    http://www.batteryfast.co.uk/compaq/nw8000.htm roj teeb nw8000 compaq,
    http://www.batteryfast.co.uk/compaq/nc8000.htm roj teeb nc8000 compaq,
    http://www.batteryfast.co.uk/compaq/v1000.htm roj teeb v1000 compaq,
    http://www.batteryfast.co.uk/compaq/nc6000.htm roj teeb nc6000 compaq,
    http://www.batteryfast.co.uk/compaq/nx5000.htm roj teeb nx5000 compaq,
    http://www.batteryfast.co.uk/compaq/n600.htm roj teeb n600 compaq,
    http://www.batteryfast.co.uk/compaq/n600c.htm roj teeb n600c compaq,
    http://www.batteryfast.co.uk/compaq/n610c.htm roj teeb n610c compaq,
    http://www.batteryfast.co.uk/compaq/n610v.htm roj teeb n610v compaq,
    http://www.batteryfast.co.uk/compaq/n620c.htm roj teeb n620c compaq,
    http://www.batteryfast.co.uk/compaq/e500.htm roj teeb e500 compaq,
    http://www.batteryfast.co.uk/compaq/e500s.htm roj teeb e500s compaq,
    http://www.batteryfast.co.uk/compaq/v300.htm roj teeb v300 compaq,
    http://www.batteryfast.co.uk/compaq/v500.htm roj teeb v500 compaq,
    http://www.batteryfast.co.uk/compaq/pp2060.htm roj teeb pp2060 compaq,
    http://www.batteryfast.co.uk/compaq/nx9000.htm roj teeb nx9000 compaq,
    http://www.batteryfast.co.uk/compaq/nx9005.htm roj teeb nx9005 compaq,
    http://www.batteryfast.co.uk/compaq/nx9010.htm roj teeb nx9010 compaq,
    http://www.batteryfast.co.uk/compaq/nx9020.htm roj teeb nx9020 compaq,
    http://www.batteryfast.co.uk/compaq/n110.htm roj teeb n110 compaq,
    http://www.batteryfast.co.uk/compaq/n110s.htm roj teeb n110s compaq,
    http://www.batteryfast.co.uk/compaq/pp2101x.htm roj teeb pp2101x compaq,
    http://www.batteryfast.co.uk/compaq/presario-2100.htm compaq presario 2100 roj teeb,
    http://www.batteryfast.co.uk/compaq/ze4000.htm roj teeb ze4000 compaq,
    http://www.batteryfast.co.uk/compaq/f4809a.htm roj teeb f4809a compaq,
    http://www.batteryfast.co.uk/compaq/f4812a.htm roj teeb f4812a compaq,
    http://www.batteryfast.co.uk/dell/inspiron-700m.htm dell inspiron 700m roj teeb,
    http://www.batteryfast.co.uk/dell/inspiron-710m.htm dell inspiron 710m roj teeb,
    http://www.batteryfast.co.uk/dell/latitude-x200.htm dell latitude x 200 roj teeb,
    http://www.batteryfast.co.uk/dell/8u443.htm roj teeb 8u443 dell,
    http://www.batteryfast.co.uk/dell/312-0058.htm dell 312-0058 roj teeb,

    Teb

sau ntawv cia

Koj email chaw nyob yuav tsis muab luam tawm. Search cim *