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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:47:54+00:00 2026-05-17T19:47:54+00:00

I am faced with the following issue. I need to capture a range of

  • 0

I am faced with the following issue. I need to capture a range of serial numbers in c# to be stored in a database. If these serial numbers are just numbers, it is fine, but I have ran into serial numbers which are alpha-numeric such as:

56AAA71064D6 and 56AAA7105A25

How can I accommodate the different possibilities that serial number ranges may be in?

Assuming that all serial numbers have some order, how can I parse the sequential part of it?

The database takes the serial numbers as strings already.

  • 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-05-17T19:47:54+00:00Added an answer on May 17, 2026 at 7:47 pm

    If your serial numbers have same width then its easy…

    you have to use string.compare method to get the range.

    int MaxLength = 20;
    
    private string Pad(string val){
       if(val.Length < 20){
          val = new String('0', MaxLength - val.Length) + val;
       }
       return val;
    }
    
    public bool IsBetween(string num, string start, string end){
        num = Pad(num);
        start = Pad(num);
        end = Pad(num);
        return String.Compare(num,start)>=0 && String.Compare(num,end)<=0;
    }
    

    And if you sort all serial numbers, then you can easily pickup range.

    If they are not of same width then you have to padd 0 before smaller length strings to make them all same size.

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

Sidebar

Related Questions

I faced following issue: I need to check is the paired device via Bluetooth
I faced the following issue while I submitting my form using jQuery FORM and
I am faced with the following issue and at this point I feel like
I am faced with the following problem. I need to (de)serialize (binary) a stream
hi i have faced an issue while accessing an object, in my program there
I am faced with the following issue. Consider the following class: //Will be similar
I'm wondering if anyone has faced this issue. Let's assume I have two tables:
I've faced with following issue, basically I do it like this: class Account(models.Model): TraffPerMonth
I'm using NHibernate 2.2 for my database work and I've faced an issue recently.
I'm faced with the following and I'm not sure what's best practice. Consider the

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.