Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:22:08+00:00 2026-06-07T17:22:08+00:00

I know the internet is loaded with information on escape characters, but I am

  • 0

I know the internet is loaded with information on escape characters, but I am not finding specifically what I need. I am querying inventory information from a database and the inventory descriptions can contain a wide variety of “dangerous” characters that need escaping. While I’m looping through my data reader, I need to replace all instances of any potential problem characters with the escaped version of that character. I’ve looked at Regex.Escape, but it leaves out a few key characters such as quotation marks. There is also Regex.Replace, but how do I tell it what the replace string should be if I the character it is replacing could be any number of things? How would I handle the following:

SQL Query returns the following result set for inventory descriptions:

  • 3/4″ Wire
  • 5′ Rope @StoreX
  • 1 1\4″ Hex Nut

**I recognize there are deeper issues with the descriptions themselves, but assuming this is the data I have to work with…

SqlDataReader dr = command.ExecuteReader()
while(dr.Read())
 {
    string partDescription = dr["Description"].ToString();  //Here is where I need to escape any characters posing a potential issue
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:22:10+00:00Added an answer on June 7, 2026 at 5:22 pm

    Do you know about the Web Protection Library (formerly known as AntiXSS)? That contains a lot of escapings (HTML, Javascript, XML).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to know if I can access internet from my proxy, I'm doing
I know Internet Explorer has a word-wrap style, but I'd like to know if
I know there are thousands of examples on the internet, but I want for
I know this is a really basic question but I've been searching the internet
I have an ivar of UITableView* myTableView. I have data being loaded from internet
I know how to check if I have internet access (using the code from
I know there are many ways over the internet but this case is a
I have been looking over the internet, but could not find the perfect tutorial
I know that conventionally for an app to interact with the internet, it must
I know that a lot of people on the Internet have expressed having problems

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.