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

  • Home
  • SEARCH
  • 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 6215373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:02:41+00:00 2026-05-24T07:02:41+00:00

Hey I am looking to create an order reference which is something like this

  • 0

Hey I am looking to create an order reference which is something like this

PLC0000001

Where the 1 would be my order id

but lets say it gets to 100 would like

PLC0000100

In VB.NET how could I build up a string like where i know i.e.

the starting part = PLC
Ending part = Order ID

middle = fill in 0’s

  • 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-24T07:02:42+00:00Added an answer on May 24, 2026 at 7:02 am

    Is it possible for you to build the order code in SQL? You could do something like this instead:

    DECLARE @Sequence INT
    SET @Sequence = 100
    
    SELECT ('PLC' + REPLICATE('0', (7 - LEN((@Sequence)))) +  CAST(@Sequence AS VARCHAR(5)) 
    

    You can change the number 7 to reflect however many leading zeros you want.

    In VB.NET you could do something like this:

    Dim Number As Integer = 100
    Dim LeadingZeros As Integer = 7 - Number.Length
    
    Dim OrderCode As String = "PLC" & Number.ToString.PadLeft(LeadingZeros, "0") 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am looking to create a Julian date format like YYDDD from the
Hey! I was looking at this code at http://www.gnu.org/software/m68hc11/examples/primes_8c-source.html I noticed that in some
Hey, I stumbled upon this site looking for solutions for event overlaps in mySQL
Hey folks. I'm looking for the best way to do something simple in symfony.
hey I'm looking for are clean solution to this problem: i start the loop
Hey im looking to developed some webservices for an Iphone, id like to do
This manages to create a new property on the object. But, can someone explain,
Hey, been looking for a while but I can't seem to find any info
Hey all. I've been looking for a while for something that can help me
hey :) ok im looking for a way to create a large number of

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.