none
How can I veiw my SQL Express db tables? RRS feed

  • Question

  • Does LS install with SQL Express a management studio to view my db tables? I dont see one.
    Tuesday, October 11, 2011 6:08 PM

Answers

  • Just try to do this:

    If you have errors to Attach mdf file, you can copy mdf and log file (ldf) into default folder for SQL Server (C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA) to have right permissions to open file.

    If you have you Solution open, that you can't open mdf file from original location of your solution bin\data or Visual Studio lock this file (Glen explained this).

     

    Hope this help

    Sapso Lazarevic


    • Edited by Spaso Lazarevic Wednesday, October 12, 2011 4:50 PM
    • Marked as answer by delanopg Wednesday, October 12, 2011 5:02 PM
    Wednesday, October 12, 2011 4:50 PM

All replies

  • No, you don't get SQL Server Management Studio Express with LS intallation.

    You need to do it by yourself (download link).

    Hope this help

    Spaso Lazarević

    Tuesday, October 11, 2011 6:45 PM
  • Thanks Spaso, I did that and connected. but I dont see the tables LS created.
    Tuesday, October 11, 2011 7:40 PM
  • Hi

    Did you try to Attach ApplicationDatabase.mdf file in SQL Server Management Studio. If you succedded then you need to get like this:

    If you have errors to Attach mdf file, you can copy mdf and log file (ldf) into default folder for SQL Server (C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA) to have right permissions to open file

    Spaso Lazarevic


    Tuesday, October 11, 2011 9:09 PM
  • Hi again

    If you do Add Table on Data Sources in Solution Explorer then you need to have tables created in ApplicationDatabase.mdf file, the same table as in your Solution. This file (mdf) is created when you first run your app in debug mode. If you don't see tables then you don't look at the right mdf file or SSMS pvodie your wrong information (do detach of your old db if exist in SSMS).

    But if you do Add Data Source then you need to conenct to another database, not intrinsic one.

    Hope this help

    Spaso Lazarevic

    Tuesday, October 11, 2011 11:11 PM
  • The Lightswitch database is attached by Visual Studio using a User instance of SQl express, when it does this the database is locked down to the user and the process that is running it. If you run your application in debug mode and connect to you management studio you should see that the database is attached, and when you disconnect it will break the connection.

    If you do want to work with the tables directly while the application is running you should use a full database engine or attach to an external datasourse when creating your lightswitch connection.

    If it is only to look at the tables while the application is not running you can always attach the database, but as the database is tightly linked with the intrinsic database and the build process this could break the end product.


    http://www.virtualrealm.com.au - SQL Server DBA, MVP and Lightswitch Enthusiast.
    Tuesday, October 11, 2011 11:42 PM
  • I want to view the datbase to view what values LS is putting in cascading combo boxes I created.

     

    Wednesday, October 12, 2011 12:46 AM
  • Hi Delan,

    I explained you how to attach to database. You didn't to that.

    Best regards

    Spaso Lazarevic

    Wednesday, October 12, 2011 5:51 AM
  • ok I goggled how to attach to database, and now I understand that.

    but when I try to attach to it, it errors and says cant open because it being used by another process.

    and LS is not running.

     

    thank you.

    Wednesday, October 12, 2011 4:46 PM
  • Just try to do this:

    If you have errors to Attach mdf file, you can copy mdf and log file (ldf) into default folder for SQL Server (C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA) to have right permissions to open file.

    If you have you Solution open, that you can't open mdf file from original location of your solution bin\data or Visual Studio lock this file (Glen explained this).

     

    Hope this help

    Sapso Lazarevic


    • Edited by Spaso Lazarevic Wednesday, October 12, 2011 4:50 PM
    • Marked as answer by delanopg Wednesday, October 12, 2011 5:02 PM
    Wednesday, October 12, 2011 4:50 PM
  • I finally did it. Thats for sticking with me on this.
    Wednesday, October 12, 2011 5:02 PM
  • I'm glad that you did it.

    Enjoy using this wonderful product (LightSwitch of course).

    Best regards

    Spaso Lazarevic

    Wednesday, October 12, 2011 5:06 PM
  • hi!

    if you just want to see database structure and data, you can try with systools mdf viewer, it is free, just browse to database location and open it:

    http://www.mdfviewer.com/

    hope it helps..

    Kivito

    Wednesday, October 12, 2011 5:57 PM