Question : SQL Server varbinary(MAX) fields with ASP.Net

I have a scenario where I have files that i need to save to an sql server database in a varbinary(MAX) field.  I have found examples where you can store one file, but say I want to store 3 files that could be .doc, .pdf, or .txt.  How would I go about first storing them, allowing user to bring them up to view in asp.net, and finally edit the files (say the user wants to delete one file from the list, but keep the other two).

I guess the main thing I'm wondering is if you can store more than one file in one field.

Thanks

Answer : SQL Server varbinary(MAX) fields with ASP.Net

As far as I know after 12 years of computing, u\you can not store mutiple documents ( doc,pdf,txt) in one filed. SO what you have to do is to make two tables. One table is the main such as EmployeID, Name, DocID (int) and the second, DocID,DocFile(varbinary(max)). So each file(document) will have one row(record).  Make relationsgip beteen the two on DocID. and every thing will work fine.

By the way , Varbinary can store upto 2GB and it is replacement  of the image datatype.
Hope this help

Random Solutions  
 
programming4us programming4us