SharepointListQueryConnection 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
The SharePointListQueryConnection class has been deprecated. Use SharePointListRWQueryConnection instead.
代表用于从 SharePoint 列表或文档库检索数据的数据连接。
public ref class SharepointListQueryConnection abstract : Microsoft::Office::InfoPath::DataConnection
[System.Obsolete("The SharePointListQueryConnection class has been deprecated. Use SharePointListRWQueryConnection instead.")]
public abstract class SharepointListQueryConnection : Microsoft.Office.InfoPath.DataConnection
type SharepointListQueryConnection = class
inherit DataConnection
Public MustInherit Class SharepointListQueryConnection
Inherits DataConnection
- 继承
- 属性
示例
在以下示例中,通过将名称Item[String]传递给 DataConnectionCollection 类的 属性,然后将返回的对象转换为 SharePointListQueryConnection 类型,设置对 SharePointListQueryConnection 对象的引用,该对象表示名为“Contacts”的连接,该连接连接到 SharePoint 上的联系人信息列表。
[C#]
SharePointListQueryConnection spConnection = (SharePointListQueryConnection)this.DataConnections["Contacts"];
Dim spConnection As SharePointListQueryConnection = _
DirectCast(Me.DataConnections("Contacts"), _
SharePointListQueryConnection)
设置了引用之后,您可以使用 SharePointListQueryConnection 对象的属性和方法。 以下示例将字符串变量设置为从 DataConnection 基类继承的属性返回Name的值。
string spName = spConnection.Name;
Dim spName As String = spConnection.Name
注解
重要提示:类 SharepointListQueryConnection 及其成员已在 Microsoft InfoPath 中弃用。 使用此类成员编写的代码仅与在 InfoPath 2003 或 InfoPath 2007 中创建的 SharePoint 文档库的数据连接、在 InfoPath 中创建的新表单模板中的数据连接(其中一个 InfoPath 2007 表单模板)或与使用“数据Connections”对话框中的“转换为以前版本”按钮转换的数据连接兼容。 若要编写与 InfoPath 表单模板中创建的 SharePoint 文档库的数据连接配合使用的代码,请使用 类的成员 SharePointListRWQueryConnection 。 此外,如果使用“数据Connections”对话框中的“转换为当前版本”按钮将数据连接转换为 SharePoint 文档库,则必须重写使用类成员SharepointListQueryConnection编写的任何代码,以改用类的成员SharePointListRWQueryConnection。
SharePointListQueryConnection 对象表示使用数据连接向导在 InfoPath 中创建的辅助数据连接,该连接指定从 SharePoint 列表或文档库检索数据所需的所有信息。
SharePointListQueryConnection 类提供了许多属性,可以使用这些属性来获取数据连接的名称以及 Windows SharePoint Services 网站上列表或文档库(连接从中检索数据)的统一资源定位器 (URL)。
可以使用 DataConnections 类的 XmlForm 属性访问与数据连接关联的 SharePointListQueryConnection 对象,以便从DataConnectionCollection表单模板的 返回连接。
默认 Execute() 方法继承自 DataConnection 基类,使用在 InfoPath 表单模板设计模式下以声明方式定义的值执行查询或提交操作。 此外, SharePointListQueryConnection 类提供了 Execute(XPathNavigator) 方法,该方法允许您指定其他位置来插入返回的数据。
SharePointListQueryConnection 类对应于 Microsoft Office InfoPath 2003 对象模型的 SharePointListAdapterObject 接口。
构造函数
SharepointListQueryConnection() |
已过时.
代表用于从 SharePoint 列表或文档库检索数据的数据连接。 |
属性
Name |
已过时.
获取数据连接的名称。 (继承自 DataConnection) |
QueryThisFormOnly |
已过时.
获取一个值,指明查询操作是否将仅应用于当前表单。 |
SiteUrl |
已过时.
获取一个 System.Uri 对象,该对象表示与 对象关联的SharepointListQueryConnectionWindows SharePoint Services站点的统一资源定位符 (URL) 。 |
方法
Execute() |
已过时.
根据从中调用数据连接的 ConnectionTypeConnection 类,使用以声明形式为已提交数据、查询参数或要检索的数据定义的值,在数据连接上执行提交或查询操作。 (继承自 DataConnection) |
Execute(XPathNavigator) |
已过时.
重写默认 Execute() 方法,以允许指定其他位置以插入返回的数据。 |