Using ASP.NET tables generated by aspnet_regsql.exe in a SQLite database

I’m building a small ASP.NET MVC site where I want to use SQLite. While I already know how I will be connecting to the database (using DbLinq), I don’t understand how to put the ASP.NET tables generated by aspnet_regsql.exe into an SQLite database.

I’ve used the regsql tool before with SQL Server, but never with SQLite. How do I create them for the SQLite DB?

  • “Index was outside the bounds of the array” while Compare SQL schema by SQL compare tool
  • Call remote function from View - SQL Server
  • full text search, filter results for best match
  • Understanding column type in indexed view in SQL Server 2008 R2
  • Exec stored procedure into dynamic temp table
  • SQL find Customers that haven't been contacted in the past 45 days
  • One strategy that I think might somehow work is:

    1. Use aspnet_regsql.exe to create the tables into an empty SQL Server database
    2. Script all the objects in the database into T-SQL
    3. Apply the T-SQL to the SQLite DB (how?)

  • Expand data in VARBINARY(max) column
  • Missing FK Relationship in Entity Framework Model
  • date ranges in where clause of index view
  • SQL Parameter Syntax: Declare @Parameter .
  • Convert date to ticks in SQL Server
  • Recovering a corrupt SQL Server databasefile
  • 3 Solutions collect form web for “Using ASP.NET tables generated by aspnet_regsql.exe in a SQLite database”

    Take a look at

    the Web.SQLite directory contains a drop in replacement for the default SQL providers.

    It was a proof of concept that turned out ok. It uses EF, so is not as performant as it could be but should service low/medium traffic sites without issue.

    You should be able to exclude all other files except that subdirectory and build it in isolation if desired. This will allow you to also trim the references.

    Let me know if you have any issues.

    You could try it with SQL Server Compact Edition 4 which is an embeddable SQL engine like SQLite but has an easier upgrade path if you need to grow it up to SQL Express or SQL Server.

    Unfortunately the aspnet_regsql will not work with SQLite, so your strategy is essentially the correct approach. However, I would suggest looking at something like Roger Martin’s Gallery Server Pro, which uses SQLite and already has the Membership, Role, and Profile provider tables scripted. You can make use of the script. See Roger’s Code Project article from more information.

    MS SQL Server is a Microsoft SQL Database product, include sql server standard, sql server management studio, sql server express and so on.