none
How to save and retrieve WordFiles using vb in mysql database ? RRS feed

  • Question

  • How do i save and retrieve WordFiles in mysql database ? (and printpreview the the saved word file im new to vb.btw ) Pls i need help :D


    Sunday, March 5, 2017 1:06 PM

Answers

  • Take a look at the following

    http://stackoverflow.com/questions/21559532/how-to-store-binary-data-in-mysql-using-vb-net

    The key is having the proper data type and to read data from the file using FileStream and BinaryReader and by changing the database to say SQL-Server the same method works as I've done in C# with SQL-Server code sample which means is universal.

    To get the file back out, use a SQL SELECT. use a DataReader and use GetBytes which in turn you feed into a FileStream to save to disk.

    Print preview, I don't have anything for that other than using Process.Start to open the document, otherwise you would need to use Word automation.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, March 5, 2017 6:37 PM
    Moderator

All replies

  • Take a look at the following

    http://stackoverflow.com/questions/21559532/how-to-store-binary-data-in-mysql-using-vb-net

    The key is having the proper data type and to read data from the file using FileStream and BinaryReader and by changing the database to say SQL-Server the same method works as I've done in C# with SQL-Server code sample which means is universal.

    To get the file back out, use a SQL SELECT. use a DataReader and use GetBytes which in turn you feed into a FileStream to save to disk.

    Print preview, I don't have anything for that other than using Process.Start to open the document, otherwise you would need to use Word automation.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Sunday, March 5, 2017 6:37 PM
    Moderator
  • Thank you :D i now understand how the process work
    Wednesday, March 8, 2017 4:11 PM