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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:58:17+00:00 2026-06-09T19:58:17+00:00

I am currently passing a parameter to a SQL string like this – grid=0&

  • 0

I am currently passing a parameter to a SQL string like this –

grid=0&

And I am using a RegEx to get the 0 value like so-

Match match = Regex.Match(input, @"grid=([A-Za-z0-9\-]+)\&$",
            RegexOptions.IgnoreCase);

string grid = match.Groups[1].Value;

which works perfectly.

However as development has progressed it is clear that more parameters will be added to the string like so-

grid=0&hr=3&tb=0

These parameters may come in a different order in the string each time so clearly the RegEx I am currently using wont work. I have looked into it and think Split may be an option however not sure.

What would the best method be and how could I apply it to my current problem?

  • 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-09T19:58:18+00:00Added an answer on June 9, 2026 at 7:58 pm

    If you’re parsing query string and looking for an alternative to Regex, there is a specialized class and method for that, it returns collection of parameters:

            string s = "http://www.something.com?grid=0&hr=3&tb=0";
            Uri uri = new Uri(s);
            var result = HttpUtility.ParseQueryString(uri.Query);
    

    You have to include System.Web namespace.
    You can access each of the parameters’ values by using it’s key:

            foreach (string key in result.Keys)
            {
                string value = result[key];
                // action...
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently passing some date-time info to a web page using url parameters, which
Currently I'm using AudioTrack passing to it audio data from native layer to play.
I'm currently trying to run a certain procedure (sql 2005) in VB6, passing some
Possible Duplicate: Passing multiple parameter to PHP from Javascript I am currently trying to
I am currently passing in the TinyMCE source as a dependency, and then calling
Currently, I'm passing a command into a user-defined function in PHP. How do I
I am passing image to Raphael. Currently image is displaying square, i want the
I am currently learning bash programming and dont really understand why the passing argument
I have an application that currently links to Google Maps passing it the required
I am deploying sql express with my application. I will like that database engine

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.