View Single Post
  #1 (permalink)  
Old August 18th, 2004, 03:29 AM
miguel.ossa miguel.ossa is offline
Authorized User
 
Join Date: Nov 2003
Location: Mataro, Barcelona, Spain.
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default bindings & date format

Hi to all!

I am getting an error when I try to do the next format adjustment:

Binding b50;
b50 = new Binding("Text", dsPacientes, "PACIENTES.pac_fecha_nac");
b50.Format += new ConvertEventHandler(this.txtFechaFormat);
txtFechaNac.DataBindings.Add(b50);

...

private void txtFechaFormat(object sender, ConvertEventArgs e)
{
   DateTime dt = (DateTime) e.Value;
   e.Value = dt.ToString("MM/dd/yyyy hh:mm:sszzz");
}

The problem is inside the function "txtFechaFormat". I've tried out with diff formats, with no results.

Does anybody can help me?

Thanks
Reply With Quote