locked
LightSwitch and SQL Server 2012 FileTable Help! RRS feed

  • Question

  •     I  have Windows 8 Pro running with a copy of Visual Studio Ultimate 2012, containing the installed product: Microsoft LightSwitch for Visual Studio 2012.  I updated this installation with the LightSwitch HTML Client for Visual Studio 2012 contained in Visual Studio 2012 Update 2.

        I am working on a LightSwitch project that requires the new SQL Server 2012 FileTable feature.  I was planning to use SQL Server 2012 Express with Advanced Services.  As far as I know, the FileTable feature extends FILESTREAM and was not available in SQL Server 2008 R2.

        My question is how do I setup SQL Server 2012 Express with Advanced Services for Microsoft LightSwitch for Visual Studio 2012?  I need to be able to develop and debug any FileTable calls long before deployment.  Thus, I cannot develop in SQL Server 2008 R2 and then later deploy to SQL Server 2012 R2, since FileTable is not a feature of SQL Server 2008 R2.

        Is there an easy fool-proof guide, or step-by-step instructions, for getting SQL Server 2012 Express with Advanced Services to work with LightSwitch in Visual Studio 2012?

        I have heard, but do not know if it is true, that LightSwitch for Visual Studio 2012 uses the SQL Server LocalDB for development and debugging.  I noticed that SQL Server 2012 Express with Advanced Services includes a 2012 LocalDB.  Can that be used in place of the default 2008 LocalDB instance.  I am assuming (since I have not actually tried it) that the SQL 2012 LocalDB can handle FileTable calls.

        For older projects can I switch back to the 2008 LocalDB, and how would I do that?

        Also, I am just assuming that LightSwitch and EF will handle the SQL Server 2012 FileTable type correctly.  I don't believe it is a blob, image or filestream, but something quite different.  Are there any known successful LightSwitch experiences with FileTable?

    Thanks.
    Wednesday, April 24, 2013 12:58 AM

Answers

  • Hi,

    LightSwitch by itself cannot create tables of type FileTable. So you cannot create a LightSwitch application and also create the application's database with tables of type FileTable.

    I don't think EF support tables of FileTable either (based on a quick search), so looks like attaching to a database with tables of type FileTable will not work either. I have not tried it but here's how I would try:

    1. Install SQL Express 2012 with SQL Management Studio.
    2. Create a database with a table of type FileTable (help article).
    3. Create an Entity Framework Model against this database and see if it works.

    Best regards,
    Huy Nguyen

    Thursday, April 25, 2013 7:31 PM

All replies

  • Hi,

    LightSwitch by itself cannot create tables of type FileTable. So you cannot create a LightSwitch application and also create the application's database with tables of type FileTable.

    I don't think EF support tables of FileTable either (based on a quick search), so looks like attaching to a database with tables of type FileTable will not work either. I have not tried it but here's how I would try:

    1. Install SQL Express 2012 with SQL Management Studio.
    2. Create a database with a table of type FileTable (help article).
    3. Create an Entity Framework Model against this database and see if it works.

    Best regards,
    Huy Nguyen

    Thursday, April 25, 2013 7:31 PM
  • Hey, if you are still dealing with the problem of trying to use FileTables with Lightswitch, try this:

    FileTable Services for Lightswitch (CodePlex)

    This is an open source extension specifically for connecting to SQL Server 2012 and 2014 FileTables. It is also published in the Visual Studio Gallery as a Lightswitch extension here. Or, you can just search for "filetable" among extensions.  I think it's the only thing you'll find with that tag.

    In short - I had the same problem - and updating EF didn't help, and no one else had a solution, so I wrote a solution.  If you are out there, let me know what you think of it!

    R/Don//

    Wednesday, May 21, 2014 9:17 PM