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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:55:22+00:00 2026-06-13T03:55:22+00:00

I am retrieving a byte blob from an SQLite database/record set. I am not

  • 0

I am retrieving a byte blob from an SQLite database/record set. I am not experienced with garbage collection yet.

When I say:

Dim bt() As Byte
bt = r.fields("mybyteblob").value

… is that okay or unsafe?

I would like to make a copy of the byte array in the record set field, and I am not sure if I am simply referencing the byte array here instead of copying it.

  • 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-13T03:55:23+00:00Added an answer on June 13, 2026 at 3:55 am

    In your code you are only referencing the byte array.
    If you want to copy it you need

    Dim bt() As Byte 
    if r.fields("mybyteblob").Value Is not Nothing then 
        dim lenArray = r.fields("mybyteblob").Length
        bt = new Byte(lenArray)
        Array.Copy(r.fields("mybyteblob").value, bt, lenArray)
    end if
    

    There is another alternative.
    The Buffer class is faster than Array and more appropriate because you are using a byte array

    Dim bt() As Byte 
    if r.fields("mybyteblob").Value Is not Nothing then 
        dim lenArray = r.fields("mybyteblob").Length
        bt = new Byte(lenArray)
        Buffer.BlockCopy(r.fields("mybyteblob").value, 0, bt, 0, lenArray)
    end if
    

    Here a good question on the two methods

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

Sidebar

Related Questions

I am retrieving an image from the SQL database into Byte() variable in VB.NET.
I'm retrieving a set of location names from a MySQL database using PHP and
I am retrieving an array values from database which save multi dimensional array..i want
I'm retrieving a signed int from a SQL Server database and need to convert
I am retrieving 3 fields from a database, and by default, only the username
I am retrieving a byte array of a pictureStream from a .net webservice. the
I experienced an issue retrieving encrypted data from an NVARCHAR field in our SQL
I have a sqlite db from where i am retrieving images. I have to
I am retrieving an image from my SQLite table and converting it to a
hey there, so in a msSQL database that i'm saving and retrieving from using

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.