How to save binary of pdf file into data table?

I have a file:

stirng file = "c:\\test.pdf";

Need to convert into binary and save the binary data into a table of a database.
Thank you.

Hi

Thanks for your inquiry. You can do this using the following simple line of code:

// Reade PDF document bytes.
byte[] docBytes = File.ReadAllBytes(@"C:\Temp\test.pdf");
// Here should be your code to write bytes to DB.
// ................................

I think the following article could be useful for you:
https://docs.aspose.com/words/net/serialize-and-work-with-a-document-in-a-database/
Hope this helps.
Best regards.