Esempio 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();
        }
 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);
     }
 }
Esempio 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();
        }