none
reading data in .bak file without using sql server RRS feed

  • Question

  • i have a database on the server that need to be updated from many clients databases , i don't want to use client sql server instead  i'm developing a windows app where the user can download from my website to read .bak file on his backup path and select the data i want and send it to my server , the reason i simply want the user to give me his database using a less complicated  software 

    Friday, January 12, 2018 3:48 PM

All replies

  • Hello,

    About the only thing that comes to mind (and I have not tried this) is using SMO (Server management objects) via the Backup class and the Restore class. From there you need to use SqlClient data provider to get at the data.

    So you need to use SQL-Server classes to access any SQL-Server database file.


    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


    Friday, January 12, 2018 5:36 PM
    Moderator
  • Maybe I am misunderstanding what you're trying to do but this doesn't sound like an actual problem.  When the .NET framework is installed then the SQL native drivers are going to be installed as well. That gives you access to ADO.NET which contains the necessary logic to do a database backup/restore.

    Assuming however that your app reads this file and displays data, how would it do that? Unless localDB or SQLExpress are installed then your app cannot read the files anyway and therefore couldn't display any data.

    Let's assume then that your app just calls to your website to read the data from the file. In this case you would likely be sending the selected data back to your site to then push to the DB server. As such the client app wouldn't need SQL anyway.


    Michael Taylor http://www.michaeltaylorp3.net

    Friday, January 12, 2018 6:44 PM
    Moderator