c# 3.0 - C# 3.0 - How can I save a file to database from a MemoryStream? -


I am trying to save a PDF file to a SQL server and I have a method that creates pdf but A window is showing this file.

But, now I have to generate a PDF, but it should be saved in the database in an image area.

And I want to show this file the memorystream object I'm ready to save, etc.

I have this:

  MemoryStream m = PDFHelper.gereratePDF (text, title);  

I was goggling AROG and I think I have to convert this memorystream to the filestream so that I can save it in DB, but I do not know how.

Thank you !!

Why do you need to save it in a file before saving it in the file?

If you do, then it is possible to pass in FileStream . However, if you need the data to be written in the database as a byte array, then you can only use the method.

(The correct way to write the data to the database will depend on how you are accessing the database in general. If you tell us more about it, then we may give more specific advice.)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -