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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:46:49+00:00 2026-05-30T12:46:49+00:00

In a C# windows app I handle HEX Strings. A single HEX string will

  • 0

In a C# windows app I handle HEX Strings. A single HEX string will have 5-30 HEX parts.

07 82 51 2A F1 C9 63 69 17 C1 1B BA C7 7A 18 20 20 8A 95 7A 54 5A E0 2E D4 3D 29

Currently I take this string and parse it into N number of integers using Convert.ToInt32(string, 16). I then add these int values to a database. When I extract these values from the database, I extract them as Ints and then convert them back into HEX string.

Would it be better performance wise to convert these string to bytes and then add them as binary data types within the database?

EDIT:

The 5-30 HEX parts correspond to specific tables where all the parts make up 1 record with individual parts. For instance, if i had 5 HEX values, they correspond to 5 seperate columns of 1 record.

EDIT:

To clarify (sorry):

I have 9 tables. Each table has a set number of columns.

table1:30

table2:18

table3:18

table4:18

table5:18

table6:13

table7:27

table8:5

table9:11

Each of these columns in every table corresponds to a specific HEX value.

For example, my app will receive a “payload” of 13 HEX components in a single string format: 07 82 51 2A F1 C9 63 69 17 C1 1B BA C7. Currently I take this string and parse the individual HEX components and convert them to ints, storing them in an int array. I then take these int values and store them in the corresponding table and columns in the database. When I read these values I get them as ints and then convert them to HEX strings.

What I am wondering is If I should conver the HEX string into a Byte array and store the bytes as SQL Binary variable types.

  • 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-30T12:46:50+00:00Added an answer on May 30, 2026 at 12:46 pm

    Well in terms of performance, you should of course test both ways.

    However, in terms of readability, if this is just arbitrary data, I’d certainly suggest using a byte array. If it’s actually meant to represent a sequence of integers, that’s fine – but why would you represent an arbitrary byte array using a collection of 4-byte integers? It doesn’t fit in well with anything else:

    • You have to consider padding if your input data isn’t a multiple of 4 bytes
    • It’s a pain to work with in terms of reading and writing the data with streams
    • It’s not clear how you’re storing the integers in the database, but I’d expect a blob to be more efficient if you’re just trying to store the whole thing

    I would suggest writing the code the more natural way, keeping your data close to the kind of thing it’s really trying to represent, and then measuring the performance. If it’s good enough, then you don’t need to look any further. If it’s not, you’ll have a good basis for tweaking.

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

Sidebar

Related Questions

In my windows phone 7 app, I have the following code to handle the
I'm trying to create a windows form app that will be able to handle
I've had a Windows app in production for a while now, and have it
In C++ Windows app, I launch several long running child processes (currently I use
I have a windows app that runs correctly in my PC that is 96DPI
I am developing a small windows app, but have some trouble deciding whether to
What I have is a C# windows app that reads a bunch of SQL
I am writing a simple Windows app in c++, that will be able to
When writing an app for Windows 8, what is the best way to handle
I`m writing client-server app for windows using WinSock and I have class for server.

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.