In my database MYDB I have a table called MYTABLE and I have a column called Description. I am saving a long description in there with multiple HTML tags.
How can i return the va开发者_开发问答lues and not include all the HTML tags?
Is this even possible? What will be the best way of doing this? In the SQL statement or in code behind? And how will I do it?
See following
Best way to strip html tags from a string in sql server?
http://blog.sqlauthority.com/2007/06/16/sql-server-udf-user-defined-function-to-strip-html-parse-html-no-regular-expression/
You are going to have to use some form of HTML parsing. If it is for basic HTML parsing then some form of Regex should suffice. However, for more advanced parsing you should look at something like HtmlAgilityPack. I use this to parse emails and I must say it works pretty well.
精彩评论