English 中文(简体)
什么是查询“分享点”数据的最佳途径?
原标题:What is the best way to query SharePoint data?

如果我只是使用《反歧视法》。 该网络可直接查阅数据库中的基本数据,或的确。 该网络有更好的办法这样做?

我目前正在使用“2007年”号,但我们即将到2010年。 我正在使用2010年视觉演播室。

最佳回答

我将高度建议使用“共享点”物体获取数据(无论是SP*级还是使用“共享点”网络服务、LINQ到“共享点”等)。

直接使用纯粹的指定经营实体进入基本数据库。 NET。 主要原因是,通过使用支持的(官方)数据获取方式,你降低了造成问题的风险。 例如,在表格中改变数据时,你不知道数据库中另一个表格是否必须更新。 点击器将照顾你们。

此外,我认为,如果Microsoft能够直接查阅数据库,那么微软不会支持与你的“共享点”代码有关的问题,而且如果Microsoft可能随时改变数据库结构,那么在任何热点固定点或特殊产品释放之后,你的代码可能不会执行。

问题回答

你们是否谈论习俗数据库或共享点数据库?

你们永远不应直接接触分享点数据库,因为数据库将使你的农场处于无支持状态。

If you want to access, custom database, consider using Entity Framework: http://msdn.microsoft.com/en-us/library/aa697427(VS.80).aspx

这取决于具体情况。 回答下列问题将有助于你作出最佳选择,向前迈进。

www.un.org/Depts/DGACM/index_spanish.htm 哪类数据?

。 使用网络服务

Aggregating content fromsite Collection? 使用服务器物体模型

www.un.org/Depts/DGACM/index_spanish.htm 我试图与数据做些什么?。

考虑使用CQWP(Content Query WebPart)或DVWP(Data View Webpart)

www.un.org/Depts/DGACM/index_spanish.htm 我完成这一解决办法的时间表是什么?

如果你在截止日期之前就没有做过“共同点”代码的部署,那么你就会在很紧的限期内试图绕过网络服务。

You should definitely not access the SharePoint content databases directly.

有一个搜索网络服务,你可以用来获取物品,或者名单网络服务使你能够轻易地提取数据。 如果你在“SongPoint”内主办你的代码,则使用“Song Point”物体模型。 了解你们的需要就足够简单。

正如其他人所说的那样,并不直接触及数据库。 微软赢得了支持,即使这样做,数据库结构也没有记录,而且比你首次开放数据库时更为复杂。

共享点物体模型中有许多物体。 然而,如果你试图对名单提出疑问,其中几个代表团特别有用。 我给你一份我认为你应该开始的简短清单。 如果你对这些内容和它们所代表的内容感到安慰,你就不时找到其他人(无论是通过你利用什么功能返回还是通过MSDN)。

1. SPList

Probably the type you ll end up dealing with the most. A SPList represents any kind of SharePoint list. That is a document library, a survey, a picture library, or any sort of custom list you could of made. Almost everything in SharePoint is a list, from the User Information List (which is used for authentication) to a blog (which is a list of blog entries). The items inside a list are SPListItem

<>strong>2. SPWeb Site<><>>>><>>><>>>><<>>>>>>>>><>>>>><>>>>>><>>><>>>>>>>><><>>>>>>>>>>>>>>><>>>>>><><>>>>>>>>>>>>><>>>>>>>>><>>>>>>>>>>>>>>>>>>>>>><><>>>>>>

Now this is a bit confusing but a SPSite represents a Site Collection and a SPWeb represents a single Site. Say you have a SharePoint site on hXXp://SharePointSite.com well the Site Collection (SPSite) would be hXXp://SharePointSite.com and a SPWeb would be hXXp://SharePointSite.com/blog or hXXp://SharePointSite.com/about Basically, a Site Collection is a collection of SPWeb, which are a collection of SPList (and other things you won t care about). A SPList always lives inside a web.

3. SPQuery

This is SharePoint s SQL. Though there is a way to do LINQ 2 SharePoint in 2010 (and even in 2007 but I wouldn t bother with it if you re about to move to 2010 anyway), you ll still have to use this sometimes. You use SPQueries anytime you want to extract items from a list. Sometimes, looping on all items from a list : foreach(item in SPList.Items) is fine, but when the lists get bigger you ll want to query them with SPQuery (same as with SQL / ADO really)

把它统统统统统统统统统统统统处。 你在座的某个地方有一份人名单,想找18岁的人。 你的法典希望:

    using(SPSite site = new SPSite("http://sharepointsite.com"))
    {
        using (SPWeb web = site.RootWeb)
        {
            SPList peopleList = web.Lists["People"];
            SPQuery query = new SPQuery();
            query.Query = 
                    "<Where>" +
                        "<Eq>" +
                            "<FieldRef Name= Age /><Value Type= Number >18</Value>" +
                        "</Eq>" +
                    "</Where>";

            SPListItemCollection items = peopleList.GetItems(query);

            foreach(SPListItem item in items)
            {
                //item here represents a person who s 18 years old.
            }
        }
    }

用于制造特殊产品质量的丑恶语言(或标记)称为CAML。 如果需要帮助,那么你可以选择帮助,但让你开始读到,这篇文章解释了许多内容。 这是我用来帮助我进行问询的工具:U2U CAML Buildinger

因此,虽然可以通过网络服务查询清单,但我建议予以反对。 如果你能够在安装了“共享点”的机器上操作你的代码,那么目标模型比网络服务要好/更直观,因为如果“共享点”没有安装,网络服务就只能作为替代。 只有在你需要时才使用。 他们返回的数据是XML,格式是一种痛苦。 这两项职能中都有一些职能。





相关问题
Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How do I compare two decimals to 10 decimal places?

I m using decimal type (.net), and I want to see if two numbers are equal. But I only want to be accurate to 10 decimal places. For example take these three numbers. I want them all to be equal. 0....

Exception practices when creating a SynchronizationContext?

I m creating an STA version of the SynchronizationContext for use in Windows Workflow 4.0. I m wondering what to do about exceptions when Post-ing callbacks. The SynchronizationContext can be used ...

Show running instance in single instance application

I am building an application with C#. I managed to turn this into a single instance application by checking if the same process is already running. Process[] pname = Process.GetProcessesByName("...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签