none
Can't add an existing database to a project

    Question

  • Hello,

    I have a database that I developed and use in a project. I want to use the database in a new application. I create a new project, click Project|Add New Data Source. I choose Database/Dataset. On the "Choose your Data Connection" screen, I click the New Connection button. On the "Add Connection" screen, I select my Data Source, and click Browse under Connection Properties. At this point, I get a message that Visual Studio has stopped working, and is restarting. It then shuts down and restarts.

    I have used a database created in one application in another several times without a problem.

    I have uninstalled VS and reinstalled it, and it still does it.

    I'm using VS 2012.

    What's going on?

    Thanks, Ralph

    Thursday, March 23, 2017 3:58 AM

All replies

  • Hi Ralph,

    Welcome to MSDN forum.

    Please connect to a new database to check if the issue persists and have a try with delete or rename the following folders:

    • C:\Users\<your users name>\AppData\Local\Microsoft\VisualStudio\11.0
    • C:\Users\<your users name>\AppData\Roaming\Microsoft\VisualStudio\11.0

    Meanwhile, go to Tools->Import & Export Settings -> Choose Reset all settings

    When you open visual studio, run it as administrator.

    If the issue persists, please reproduce the steps you met the issue and then run the command: devenv /log in the evaluated command prompt. And upload the file (%APPDATA%\Microsoft\VisualStudio\Version\ActivityLog.xml) to https://onedrive.live.com/ and share the link here.

    In addition to this, try to install the latest version of visual studio.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 24, 2017 2:20 AM
  • Hi, Joyce,

    I am able to create and connect to a  new database in a new project.

    Deleting those folders did not help. I do not know what the evaluated command prompt is, so I used  cmd to open a command prompt, typed devenv /log, and it said that can only be ran in a batch file.

    Thanks,

    Ralph.

    Friday, March 24, 2017 11:25 PM
  • Hi, Joyce,

    According to what I found on-line, the evaluated command prompt is just the Immediate window, is that right? If it is, I can't do the devenv command because VS restarts, right?

    One strange thing: If I pick another Data Source, like Access, VS doesn't stop and restart.

    Thanks,

    Ralph

    Saturday, March 25, 2017 4:50 AM
  • Hi Ralph,

    Thank you for your update.

    Yes, using cmd to open a command prompt, please see the following screenshots.

    >>I am able to create and connect to a  new database in a new project

    One strange thing: If I pick another Data Source, like Access, VS doesn't stop and restart.

    Please also check if your database has been changed.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 27, 2017 9:51 AM
  • Hi, Joyce,

    I've never used OneDrive before, so I followed the link in a previous message of yours, and dragged ActivityLog.xml to the VB folder. I hope I did it right, and that you can see it.

    Thanks, Ralph

    Tuesday, March 28, 2017 10:16 PM
  • Hi,

    Thank you for your update.

    Do you mean that your visual studio will stop working when you select specific Data Source? What is the data source?

    About upload your log file, please sign in https://onedrive.live.com/ , click upload and then select the file, click share. After this, sharing the link here.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, March 29, 2017 8:57 AM
  • Hi,

    Thank you for your update.

    Do you mean that your visual studio will stop working when you select specific Data Source? What is the data source?


    Hi, Joyce,

    No, VS stops when I click the browse button to select the database. The data source of the database that I want to add is SQLServerCE. If I pick Access as the data source (just experimenting), I can browse with no problem.

    Ralph's Activity Log

    Ralph 

    Thursday, March 30, 2017 10:06 PM
  • Hi,

    Please go to extensions and updates to uninstall it and then reinstall to check if the issue persists.

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 31, 2017 8:34 AM
  • Hi, Joyce,

    I went to the extension manager, and nothing that had to do with SQL Server Compact Edition was installed, so I opened the on-line gallery, and searched for sql. The SQLite / SQL Server Compact Toolbox came up. I downloaded and installed it, restarted VS, tried to add an existing  database, and the same issue happened.

    I don't understand it - I've been adding existing databases to new applications for a long time with VS 2012.

    Ralph

    Sunday, April 2, 2017 7:19 PM
  • Make sure the SQL server is still running.  To do this, run Services.msc and scrill down until you reach SQL servers or SQL server agent section and see if they are running.

    I am assuming you are running a SQL database file and not LocalDB.  For LocalDB there is another way to connect.

    Sunday, April 2, 2017 8:11 PM
  • Hi, EN59CVH,

    I am using a SQL Server Compact Edition database. I don't have SQL Server.

    Thanks,

    Ralph

    Sunday, April 2, 2017 10:14 PM
  • Hi Ralph65,

    Thank you for your update.

    Please use visual studio 2015 or 2017 to check if the issue persists.

    The web installer of visual studio community 2015, you could download from here: https://www.microsoft.com/en-us/download/details.aspx?id=48146

    You could get vs2017 from here: https://www.visualstudio.com/downloads/

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by Ralph65 Tuesday, April 4, 2017 3:09 AM
    • Unmarked as answer by Ralph65 Monday, April 17, 2017 11:12 PM
    Tuesday, April 4, 2017 1:34 AM
  • Thank you, Joyce.

    Ralph

    Tuesday, April 4, 2017 3:08 AM
  • Hi, Joyce,

    I just set up a VM, and installed VS 2012, and started a new project, and added an existing SQLSever Compact Edition database with no problem.

    Is there a way to totally uninstall VS from my host?

    Thanks,

    Ralph

    Monday, April 17, 2017 11:21 PM
  • Hi Ralph,

    Glad to know that everything is ok in your VM, to uninstall visual studio 2012, please have a look at this:

    https://support.microsoft.com/en-sg/help/2771441/how-to-uninstall-visual-studio-2012

    Best regards,

    Joyce


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, April 18, 2017 6:44 AM
  • Hi, Joyce.

    I went to the article you gave me the link to, went to my  command prompt, and typed G:\VS12\vs_ultimate.exe /uninstall /force. It did not give me a choice to uninstall VS as the article said it would, it just installed VS!

    How can I completely uninstall VS?

    Thanks,

    Ralph

    Friday, April 21, 2017 11:42 PM