C# 如何更新数据表中的字段

发布于 2024-10-08 06:49:00 字数 373 浏览 0 评论 0原文

我有一个 .net/ c# 控制台应用程序,其中包含从数据库填充的 DataTable

我想对 DataTable 中的字段运行更新以剥离 HTML。我在控制台应用程序中执行此操作的函数称为:StripTagsCharArray

其定义为:

static private string StripTagsCharArray(string source)

如何调用它来更新DataTable 中的“描述”字段?

我想看看这是否会提高我的应用程序的性能,因为现在我有一个 SQL UDF 执行 HTML 剥离。

I have a .net/ c# console app with a DataTable that I populated from a Database.

I want to run an update on a field in the DataTable to strip the HTML. the function i have in the console app to do this is called: StripTagsCharArray

its defined as:

static private string StripTagsCharArray(string source)

how can i invoke this to update the Description field in my DataTable?

i want to see if this will improve performance of my application as now i have a SQL UDF doing the HTML stripping.

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

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

发布评论

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

评论(1

旧人 2024-10-15 06:49:00

万一有人需要这个:

foreach (DataRow row in tmp.Rows)
            {
                row["Description"] = StripTagsCharArray(row["Description"].ToString());
            }

in case some one needs this:

foreach (DataRow row in tmp.Rows)
            {
                row["Description"] = StripTagsCharArray(row["Description"].ToString());
            }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文