Exemplo n.º 1
0
        public void ThrowsIfNullParameterNameIsPassed()
        {
            using (TestResourceFile dbFile = new TestResourceFile(this, "Datastore.sdf"))
            {
                using (SmartClientDatabase database = DatabaseFactory.CreateDatabase() as SmartClientDatabase)
                {
                    string      sql   = @"SELECT COUNT(*) FROM Customers WHERE ContactName = @Name";
                    DbParameter param = database.CreateParameter(null, "Maria Anders");

                    Assert.AreEqual(1, database.ExecuteScalar(sql, param));
                    database.CloseSharedConnection();
                }
            }
        }