-1

I’m developing an ASP.NET MVC application that is using a LocalDb database. This app also needs to have a corresponding Windows service that runs all the time. After much research, it looks like LocalDb is not a wise choice for deployment because of needing to have two users and concurrent access and 24/7 up time.

The app I’m building won’t be deployed to one server, it will be bundled up in an installer and distributed to multiple users. This would me so much simpler if I could justify distributing SQL Server Express 2012, but blowing up the installer by 120MB and using 300MB on disk is something I’m trying very hard to avoid.

The load on the database will very light -- the web app is using the SimpleMembership provider and besides the membership tables, there are only a handful of other tables that will never have any significant amount of data in them. In previous versions of this app, I used an XML membership provider that stored user and role data on disk and the other data in my own XML configuration file. Some customers had security concerns about that so I would like moving membership and config data to a database so customers could point the app to their own SQL Server and do all the security they want with it.

I also would like the Windows service to use SQL Server Broker and SqlDependency to detect changes that the web app makes in the database.

SQL Express is out because it’s so big and this app needs to go on some embedded systems that I could not likely get permission to put it on.

LocalDb is probably out for the reasons I stated above.

SQL Server Compact – I’ve never worked with it. My understanding is that it runs in-process – can that process be my Windows service so that it’s always running? Can I access it concurrently with the web app? Will the SimpleMembership provider work with it? Any idea if SqlDependency works with it or is it back to polling?

4

2 に答える 2

1

小さな sql データベースが必要な場合は、これを試してみてはいかがでしょうか。SQLlite はわずか数百キロバイトで使いやすいです。

http://code.google.com/p/csharp-sqlite/の ac# ポートがあります。

また、C# プロジェクトでの sql lite の使用に関する情報も多数あります。

詳細については、このリンクを参照してください: http://www.codeproject.com/Articles/22165/Using-SQLite-in-your-C-Application

SQLite 用の .NET/C# ラッパーはありますか?

私はそれを少しだけテストしました。それは非常に小さく、高速で、シンプルで、SQL 構文は多くの場合同じです。同じようにできないのはT-SQLの扱いですが、あなたが言ったように、いくつかの単純なデータを保存するだけなので、試してみてください。

于 2013-01-23T19:02:08.857 に答える
0

はい、Windowsサービスとasp.netの両方が同じマシンで同時にデータベースにアクセスできます。SimpleMemberShip これで動作しますが、SqlDependency はありません。

于 2013-01-23T20:09:09.147 に答える