Not knowing which RDBMS you’re using and if you’re coding in C# or VB.Net I can only point you in a general direction. Here are a couple of links:
- Working with binary large objects (BLOBs) (C# using ADO.NET)
- Writing BLOB Values to a Database (VB.Net using ADO.NET)
- Save files in database with entity framework (C# with Entity Framework)
solved how to save and retrieve file in database as blob in asp.net [closed]