This text is replaced by the Flash movie.

Search codeauthority.com
 dallas custom software design

   Sunday, September 07, 2008 Login   
dallas custom software design development
This text is replaced by the Flash movie.
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