Store Excel Sheet (.xls) in DB2 database
How do I store Excel Sheet / xls file to DB2 database using C# ? I need to store the sheet to save data and preserve the template. Will Read data / fe开发者_运维问答tching file from db work for all data types i.e. Pictures / Charts /Graphs ? Any tutorial online ?
Assuming you want to store the excel file as-is and not read the data it contains, you probably want to use the BLOB (Binary Large Object) datatype in DB2. The IBM documentation for the .NET binding is here.
If you use a BLOB, you should be able to save and restore any type of object.
EDIT:
To read and write files to byte arrays, see this question. I don't have a DB2 instance up at the moment, but the standard ADO.NET methods for reading and writing large objects should work. An example for SQL Server is here, and you should be able to swap the SQL Server classes for the DB2 classes.
精彩评论