Search codeauthority.com
  dallas custom software design

   Wednesday, March 10, 2010                                                  (214) 774-4262    (800) 457-7163                                                           Login   
dallas custom software design development
dallas custom software development
 DEVELOPER'S BLOG SEARCH
  

 Using LLBLGen Pro ORM, Nullable DateTime and NullableDateTimePicker
Location: BlogsSONNY'S INFINTE WELL OF DEVELOPER HAPPINESS    
Posted by: Sonny Wilson Monday, October 29, 2007
Here are a couple of examples of how to retrieve and update a nullable db column of datetime datatype using LLBLGen Pro and present the editable/nullable value within a NullableDateTimePicker object.

// retrieving nullable Date from DB to NullableDateTimePicker  ************************************************************************** 

PaymentEntity oPayment = new PaymentEntity(iPaymentID); 

if (oPayment.CheckDate > dtpCheckDate.MinDate && oPayment.CheckDate < dtpCheckDate.MaxDate)

{

dtpCheckDate.Checked = true;

      dtpCheckDate.Value = oPayment.CheckDate;

}

else

      dtpCheckDate.Checked = false;

 

  

// updating nullable Date from NullableDateTimePicker to DB  ************************************************************************** 

PaymentEntity oPayment = new PaymentEntity(iPaymentID); 

if (dtpCheckDate.Value == DBNull.Value)

oPayment.SetNewFieldValue("CheckDate", null);

else

oPayment.CheckDate = (DateTime)dtpCheckDate.Value;

 

oPayment.Save();

 

Permalink |  Trackback
  

 

Dallas, Texas Mxlogic Reseller