You can use
OpenFileDialog[
^] in WinForms. see the example on the same page. you can store the
myStream
in the SQL Server '
Image
' / '
VarBinary
' datatype and retrieve it anytime.
If you need an example how to store binary contents in sql server then
here is a nice example.[
^].
Following are the steps to Store / Retrieve document using SQL Server
1) read the file contents in binary array using
OpenFileDialog
.
2) save the binary contents in sql server table, that has atleast one column (
FileContents
) with data type either
Image
or
VarBinary
and another one with
FileName
VarChar
(255).
3) Read the contents of the
FileContents
column and save it in a temp folder with the
FileName
column. and read the file from there...