开发者

c# how to update a field in a dataTable

开发者 https://www.devze.com 2023-01-30 17:54 出处:网络
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 th

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.


in case some one needs this:

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

精彩评论

暂无评论...
验证码 换一张
取 消