01.
FileStream fs;
02.
BinaryReader br;
03.
long
FileSize;
04.
05.
string
FileName = textBox6.Text;
06.
byte
[] fileData;
07.
fs =
new
FileStream(FileName, FileMode.Open, FileAccess.Read);
08.
FileSize = fs.Length;
09.
br =
new
BinaryReader(fs);
10.
11.
fileData= br.ReadBytes((
int
)fs.Length);
12.
br.Close();
13.
fs.Close();
14.
15.
string
strQuery =
"INSERT INTO f_file (f_id,f_name,f_size,f_byte) VALUES('"
+ fid +
"', '"
+ fileName +
"', '"
+ FileSize +
"', '"
+ fileData +
"') "
;
16.
17.
DB.Insert(strQuery);