Skip to content

Instantly share code, notes, and snippets.

@sandrinodimattia
Created July 22, 2012 19:37
Show Gist options
  • Save sandrinodimattia/3160832 to your computer and use it in GitHub Desktop.
Save sandrinodimattia/3160832 to your computer and use it in GitHub Desktop.
DbProviderFactoryDescription
public class DbProviderFactoryDescription
{
/// <summary>
/// Gets or sets the name.
/// </summary>
/// <value>The name.</value>
public string Name { get; set; }
/// <summary>
/// Gets or sets the invariant.
/// </summary>
/// <value>The invariant.</value>
public string Invariant { get; set; }
/// <summary>
/// Gets or sets the description.
/// </summary>
/// <value>The description.</value>
public string Description { get; set; }
/// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
public string Type { get; set; }
/// <summary>
/// Initialize the description.
/// </summary>
public DbProviderFactoryDescription()
{
}
/// <summary>
/// Initialize the description.
/// </summary>
/// <param name="name"></param>
/// <param name="description"></param>
/// <param name="invariant"></param>
/// <param name="type"></param>
public DbProviderFactoryDescription(string name, string description, string invariant, string type)
{
this.Name = name;
this.Description = description;
this.Invariant = invariant;
this.Type = type;
}
/// <summary>
/// Initialize the description based on a row.
/// </summary>
/// <param name="row">The row.</param>
internal DbProviderFactoryDescription(DataRow row)
{
this.Name = row[0] != null ? row[0].ToString() : null;
this.Description = row[1] != null ? row[1].ToString() : null;
this.Invariant = row[2] != null ? row[2].ToString() : null;
this.Type = row[3] != null ? row[3].ToString() : null;
}
}
/// <summary>
/// Db Provider Description for Sql CE 3.5
/// </summary>
public class SqlCe35ProviderFactoryDescription : DbProviderFactoryDescription
{
public const string ProviderName = "Microsoft SQL Server Compact Data Provider";
public const string ProviderInvariant = "System.Data.SqlServerCe.3.5";
public const string ProviderDescription = ".NET Framework Data Provider for Microsoft SQL Server Compact";
public const string ProviderType = "System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe";
/// <summary>
/// Initialize the description.
/// </summary>
public SqlCe35ProviderFactoryDescription()
: base(ProviderName, ProviderDescription, ProviderInvariant, ProviderType)
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment