preferably using VB .Net, i'd like to insert a file (Word document, Excel, PDF, text) into a SQL database varbinary column, and also extract and save the file from the database.
there are other fields that get inserted, and that happens with this code:
Dim TheSQLConnection As New System.Data.SqlClient.SqlConnection
Dim TheSQLCommand As New System.Data.SqlClient.SqlCommand
Dim TheInsertString as string
... open the connection using a connection string
... set the value of TheInsertString to an insert query
TheSQLCommand.Connection = TheSQLConnection
TheSQLCommand.CommandText = TheInsertString
i'm not sure how to add the file to the insert command, or if there is another way to get this done.
this is quite easy to do in MS Access, using the Attachment field type but seems to be more difficult to do with SQL Server.