SQL Server

To use Iridium with SQL Server, you have to install the iridium.db.sqlserver package.

Using a SQL Server database

var connectionString = "Server=MYSERVER;Database=MYDB;User ID=USERID;Password=PWD;Integrated Security=false";
var dbContext = new StorageContext(new SqlServerDataProvider(connectionString));

// ...

dbContext.CreateTable<Customer>();
//
dbContext.DataSet<Customer>().Save(new Customer { Name = "John" });
//
var johnCustomers = from c in dbContext.DataSet<Customer>()
                    where c.Name.StartsWith("John") 
                    select c;
The better way
public class DbContext : SqlServerContext
{
     public DbContext() 
        : base("Server=MYSERVER;Database=MYDB;User ID=USERID;Password=PWD;Integrated Security=false")
     {
     }

     public IDataSet<Customer> Customers {get;set;}
     public IDataSet<Product> Products {get;set;}
}

// ...

var dbContext = new DbContext();
//
dbContext.Customers.Save(new Customer { Name = "John" });
//
var johnCustomers = from c in dbContext.Customers 
                    where c.Name.StartsWith("John") 
                    select c;