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 9269989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:15:38+00:00 2026-06-18T15:15:38+00:00

I have problem searching for a long string that contains special character in MS

  • 0

I have problem searching for a long string that contains special character in MS Access. Here is my sample data.

staff_Id | hashValue
   1     | 4ENOA2838F09dbfTKXeAdEIKRM91MdsDg0W4pRNChdkGa7iwoVifWH9avZdjrPp1QqLJ0ecNe/X716HlwqfSYA==

Here is my SQL command.

SELECT *
FROM table
WHERE hashValue='4ENOA2838F09dbfTKXeAdEIKRM91MdsDg0W4pRNChdkGa7iwoVifWH9avZdjrPp1QqLJ0ecNe/X716HlwqfSYA==';

I had tried googling for escape characters, however I cannot get this working. Hope that you can help me. Thank you.

P.S. I am developing a C# program that interacts with MS-access

UPDATE

Here is my SQL query in my C# program that execute the search query.

string sqlStatement = "SELECT * FROM table WHERE hashValue = @hashedValue";
using (OleDbConnection connection = new OleDbConnection(connString))
{
    using (OleDbCommand command = new OleDbCommand())
    {
        command.Connection = connection;
        command.CommandText = sqlStatement;
        command.Parameters.AddWithValue("@hashedValue", hashedValue);

        ds = new DataSet(); //have been declared
        dbAdapter = new OleDbDataAdapter(); //have been declared
        dbAdapter.SelectCommand = command;
        dbAdapter.Fill(ds, "table"); //empty dataset here
    }
}
  • 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-18T15:15:39+00:00Added an answer on June 18, 2026 at 3:15 pm

    in C# try writing the command like this:

    string hashValue = @"4ENOA2838F09dbfTKXeAdEIKRM91MdsDg0W4pRNChdkGa7iwoVifWH9avZdjrPp1QqLJ0ecNe/X716HlwqfSYA==";
    
    string sql = string.Format("SELECT * FROM table WHERE hashValue = '{0}'", hashValue);
    

    notis the @ mark before the string. this allows you to have string that look like this:

    string test = @" \ ";
    Console.WriteLine(test); //output: \
    

    In your case you can do it like this:

    command.Parameters.AddWithValue("@hashedValue", @hashedValue);
    

    but the @-trick works best if its set when the string is declared.

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

Sidebar

Related Questions

I tried searching and didn't find anything that fixed my problem. I have a
I have tried solving this problem by posting other related questions here that focused
I have a long string. Within that string there are certain characters I need
I have a function pulled from here . My problem is that I don't
I have a very tricky problem and after long searching (google, stackoverflow, ...) i
I have a complex long XHTML file, which contains CSS. Searching on google and
I've been searching for a problem that have annoyed me for a while (but
i have one problem controlling checkbox, i'm reading, and searching about the topic but
i have a little problem, i'm searching, but i can't found what i need,
I have tried searching over the internet about this problem but not able to

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.