Shup
June 13th, 2006, 04:46 PM
I want to use varBinary to store some values but I'm a little confused on choosing the correct size for the data type. I'm not use to dealing with binary.
I think I understand that Binary is stored as bytes...? If, for example, I have a string that is going to be a maximum of 30 characters long, I would use the nVarChar data type with a size of 30. So if I am storing a password that is no more then 30 characters long (from an array), and saving it as varBinary, would I choose 30 as the size for the binary data type?
Also, I'm looking for a very good buffer to read binary data from the database, are there any excellent examples of a buffer I could use when reading the binary data from the database? Should I also use the buffer when saving data to the database?
Thanks in advance.
I think I understand that Binary is stored as bytes...? If, for example, I have a string that is going to be a maximum of 30 characters long, I would use the nVarChar data type with a size of 30. So if I am storing a password that is no more then 30 characters long (from an array), and saving it as varBinary, would I choose 30 as the size for the binary data type?
Also, I'm looking for a very good buffer to read binary data from the database, are there any excellent examples of a buffer I could use when reading the binary data from the database? Should I also use the buffer when saving data to the database?
Thanks in advance.