1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-26 01:38:24 +00:00
Radarr/NzbDrone.SqlCe/SqlCeProxy.cs
2013-02-16 15:29:21 -08:00

27 lines
647 B
C#

using System.Data.Common;
using System.Data.SqlServerCe;
using System.IO;
namespace NzbDrone.SqlCe
{
public class SqlCeProxy
{
public SqlCeConnection EnsureDatabase(string connectionString)
{
var connection = new SqlCeConnection(connectionString);
if (!File.Exists(connection.Database))
{
var engine = new SqlCeEngine(connectionString);
engine.CreateDatabase();
}
return connection;
}
public DbProviderFactory GetSqlCeProviderFactory()
{
return new SqlCeProviderFactory();
}
}
}