Exemplo n.º 1
0
        public void IsDBNull()
        {
            SqlConnection cn = new SqlConnection(CONNECTION_STRING);
            SqlCommand    cm = cn.CreateCommand();

            cm.CommandText = "SELECT TEXT, BIGINTFIELD, IMAGEFIELD FROM MultiDataTypes";

            cn.Open();
            using (cm)
            {
                using (Csla.Data.SafeDataReader dr = new Csla.Data.SafeDataReader(cm.ExecuteReader()))
                {
                    dr.Read();
                    Assert.AreEqual(true, dr.IsDBNull(2));
                    Assert.AreEqual(false, dr.IsDBNull(1));
                    dr.Close();
                }
            }
            cn.Close();
        }
Exemplo n.º 2
0
 private void Fetch(Csla.Data.SafeDataReader data)
 {
     using (BypassPropertyChecks)
     {
         Id = data.GetInt32("Id");
         if (!data.IsDBNull("ShipDate"))
         {
             ShipDate = data.GetDateTime("ShipDate");
         }
         Persons = DataPortal.FetchChild <OrderLinePersons>(Id);
     }
 }
Exemplo n.º 3
0
        public void IsDBNull()
        {
            SqlConnection cn = new SqlConnection(CONNECTION_STRING);
            SqlCommand cm = cn.CreateCommand();
            cm.CommandText = "SELECT TEXT, BIGINTFIELD, IMAGEFIELD FROM MultiDataTypes";

            cn.Open();
            using (cm)
            {
                using (Csla.Data.SafeDataReader dr = new Csla.Data.SafeDataReader(cm.ExecuteReader()))
                {
                    dr.Read();
                    Assert.AreEqual(true, dr.IsDBNull(2));
                    Assert.AreEqual(false, dr.IsDBNull(1));
                    dr.Close();
                }
            }
            cn.Close();
        }