Click here to Skip to main content
15,889,116 members
Home / Discussions / C#
   

C#

 
AnswerRe: Write Assembly code in C# Pin
AspDotNetDev28-May-10 14:18
protectorAspDotNetDev28-May-10 14:18 
QuestionInsert byte[] to database Pin
dataminers28-May-10 1:49
dataminers28-May-10 1:49 
AnswerMessage Closed Pin
28-May-10 1:53
stancrm28-May-10 1:53 
GeneralRe: Insert byte[] to database Pin
dataminers28-May-10 2:11
dataminers28-May-10 2:11 
GeneralRe: Insert byte[] to database Pin
PIEBALDconsult28-May-10 3:49
mvePIEBALDconsult28-May-10 3:49 
AnswerRe: Insert byte[] to database Pin
Pete O'Hanlon28-May-10 2:48
mvePete O'Hanlon28-May-10 2:48 
AnswerRe: Insert byte[] to database Pin
T M Gray28-May-10 5:20
T M Gray28-May-10 5:20 
AnswerRe: Insert byte[] to database Pin
Matt Meyer28-May-10 7:41
Matt Meyer28-May-10 7:41 
Like other have said, unless you're really experienced with SQL, you should use parameters (and even if you are really experienced, it's still a good idea).

The first problem is you appear to be using the wrong data type to store bytes. VARBINARY is a character type to store binary strings (useful for forcing case sensitivity, IE, 'a'='A' in a char type, but not a binary type) - http://dev.mysql.com/doc/refman/5.1/en/binary-varbinary.html[^] You probably wanted a BLOB type of some kind.

As for storing byte[] with an SQL statement, converting the bytes into a hexadecimal string value should work -
INSERT INTO (FileID, Data) VALUES (1, 0x0F2EAA32);
AnswerRe: Insert byte[] to database Pin
AspDotNetDev28-May-10 16:41
protectorAspDotNetDev28-May-10 16:41 
QuestionDisable Intrupt In Critical section Pin
shahramkeyboard28-May-10 0:38
shahramkeyboard28-May-10 0:38 
AnswerRe: Disable Intrupt In Critical section Pin
harold aptroot28-May-10 0:46
harold aptroot28-May-10 0:46 
GeneralRe: Disable Intrupt In Critical section Pin
Pete O'Hanlon28-May-10 1:10
mvePete O'Hanlon28-May-10 1:10 
GeneralRe: Disable Intrupt In Critical section Pin
Luc Pattyn28-May-10 2:17
sitebuilderLuc Pattyn28-May-10 2:17 
GeneralRe: Disable Intrupt In Critical section Pin
Pete O'Hanlon28-May-10 2:26
mvePete O'Hanlon28-May-10 2:26 
AnswerRe: Disable Intrupt In Critical section Pin
Luc Pattyn28-May-10 2:16
sitebuilderLuc Pattyn28-May-10 2:16 
GeneralRe: Disable Intrupt In Critical section PinPopular
Pete O'Hanlon28-May-10 2:54
mvePete O'Hanlon28-May-10 2:54 
GeneralRe: Disable Intrupt In Critical section Pin
Luc Pattyn28-May-10 4:27
sitebuilderLuc Pattyn28-May-10 4:27 
QuestionRetrieve and display server drives and folders on a client. Pin
Calla28-May-10 0:21
Calla28-May-10 0:21 
AnswerRe: Retrieve and display server drives and folders on a client. Pin
Calla28-May-10 3:25
Calla28-May-10 3:25 
QuestionProgram to start when windows starts Pin
Enobong Adahada27-May-10 21:32
Enobong Adahada27-May-10 21:32 
AnswerRe: Program to start when windows starts Pin
MayukhSen27-May-10 21:44
MayukhSen27-May-10 21:44 
AnswerRe: Program to start when windows starts Pin
Nuri Ismail27-May-10 21:44
Nuri Ismail27-May-10 21:44 
AnswerRe: Program to start when windows starts Pin
PIEBALDconsult28-May-10 3:50
mvePIEBALDconsult28-May-10 3:50 
QuestionSheet Metal Cutting Algorithm Pin
kirankkk200927-May-10 21:16
kirankkk200927-May-10 21:16 
Answercross-post !! Re: Sheet Metal Cutting Algorithm Pin
Garth J Lancaster27-May-10 23:44
professionalGarth J Lancaster27-May-10 23:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.