比较 sharepoint 列表和 sqlserver 表

发布于 2024-10-10 00:06:24 字数 313 浏览 0 评论 0原文

我在 sharepoint 中有一个列表,它维护特定月份的 OnCall 列表,并且我们在 sql server 中维护员工目录。我的要求是从 SQL Server 获取完整数据并将其显示在共享点中,并与共享点列表进行比较,并显示该特定月份待命员工的小图标。谁能告诉我实施这个的原因。

提前致谢。

更新:我已经完成了必须连接到 sqlserver 数据库并获取员工信息的部分。为此,我们使用第 3 方 Web 部件连接到 sql 服务器并从表中提取数据。现在,我必须在员工姓名上显示某种图像,以表明他在那周待命。我们将创建自定义列表来维护待命人员列表。谁能告诉我如何实现这一目标。

I have a list in sharepoint which maintains particular month OnCall list,and we are maintaining employee directory in sql server. My requirement is to get complete data from sql server and show it in sharepoint and compare with sharepoint list and show small icon for the employees who are On Call for that particular Month. Can anyone please suggest me the waus of implementing this.

Thanks in advance.

Update: I have finished the part where I have to connect to the sqlserver database and get the employees information. For this we are using 3rd party web part to connect to the sql server and pull the data from the table. Now I have to show some kind of image on the employee name to show that he is on-call for that week. We are going to cretae custom list for maintaing the list of people who are on-Call. Can anyone please advise me on how to accomplish this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

浅沫记忆 2024-10-17 00:06:24

编写一个自定义 Web 部件,该部件将使用共享点对象模型和使用 ADO.NET 的 SQL Server 从列表中提取数据,并进行上述比较。

如果您正在寻找开箱即用的产品,恐怕这里提供的信息太少,无法分析其开箱即用是否可行。

Write a custom webpart which will pull the data from the list using sharepoint object model and SQL server using ADO.NET and do the said comparison.

If you were looking for out of the box, I am afraid there i too little information given here to analyze if its feasible out of the box or not.

各自安好 2024-10-17 00:06:24

如果您有 SharePoint Enterprise 版本,您可以查看使用 业务数据目录。这将允许您将列绑定到外部数据源。这可能会为您提供您正在寻找的功能。

如果您没有企业版功能,您是否有权部署 WSP 包和自定义代码?

您必须编写自己的对外部数据源的数据访问。您的选择是拥有一个从外部数据源提取数据并填充 SharePoint 列表的作业,或者创建一个按需提取外部数据的自定义视图。

您必须想出同步策略。意思是,外部 SQL 数据源中的数据是否是静态的、不需要根据用户在 SharePoint 中执行的操作进行更新的参考信息?根据您的问题,情况似乎如此。如果您确实需要更新外部数据源,则必须挂钩保存事件(因此可能是 自定义事件处理程序,用于侦听 ItemAdding)以更新数据、验证并可选择取消操作并显示错误消息。

如果您无法部署 WSP 包/DLL,您可以查看 jQuery SharePoint 库。这将允许您使用 jQuery 与列表进行交互。如果您还围绕需要从可从 SharePoint 环境访问的外部数据源访问的数据编写 WCF 或 Web 服务包装器,则可以将解决方案结合使用。

为此,您需要将内容编辑器 Web 部件放置在需要自定义数据访问的页面上。您将在其中编写代码来引用 jQuery javascript 库和 jQuery SharePoint 库。该代码必须调用您的外部数据服务并进行您需要的任何更新。

这是完成您想要的任务的最不可靠的方法,因为它完全基于页面,并且可以通过简单地禁用脚本或某人编辑 CEWP 或完全删除它来破坏。

如果您无权放置 CEWP 或任何其他解决方案,那么您根本没有选择。

If you have the SharePoint Enterprise version, you can look at using the Business Data Catalog. This will let you bind columns to external data sources. This might provide you with the functionality you're looking for.

If you do not have the Enterprise features, do you have access to deploy WSP packages and custom code?

You will have to write your own data access to your external data source. Your options would be to have a job that pulls data from the external data source and populates SharePoint list(s) or create a custom view that pulls the external data on-demand.

You'll have to come up with synchronization strategies. Meaning, is the data in the external SQL data source static, reference information that does not need to be updated depending on what a user does in SharePoint? This seems to be the case based on your question. If you do need to update the external data source, you'll have to hook into the on save event (so probably a custom event handler that listens for ItemAdding) to update the data, validate, and optionally cancel the operation with an error message.

If you can't deploy WSP packages / DLLs, you could take a look at the jQuery SharePoint library. This will let you interact with lists using jQuery. If you also write a WCF or Web Service wrapper around the data you need access to from your external data source that is accessible from the SharePoint environment, you can use hack together a solution.

To accomplish this you'd need to place a Content Editor Web Part on the page you need custom data access. In there you will write the code to reference the jQuery javascript library and jQuery SharePoint library. The code will have to make the calls to your external data service and make any updates you need.

This is the least reliable method to accomplish what you want since it's entirely page-based and can be broken by simply disabling script or someone editing the CEWP or removing it altogether.

If you don't have access to place a CEWP or any of the other solutions, then you have no options at all.

尛丟丟 2024-10-17 00:06:24

现在使用第三方 Web 部件提取所有数据并将其保存到自定义列表中相对容易。我建议您不仅创建自定义列表,而且还为此列表创建内容类型。查看 SharPoint MVP 关于使用 内容类型

it relatively easy now to pull all the data using the third party webpart and saving it into a custom list. I would recommend you not only creating custom list but also creating the content types for this list. take a look at SharPoint MVP's post about creating a Custom List with Content Types

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文