PC Review


Reply
Thread Tools Rate Thread

[data binding ] set the date format in the textbox.

 
 
Agnes
Guest
Posts: n/a
 
      16th May 2004
In my tables, there are invoicedate, as i use databinding, bind the
invoicedate to the textbox,
It show mm-dd-yyyy time. I need to change it into date dd-mm-yyyy only
without time .
how can i do that ???

I think I should not change it into string.
Please help.


 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      16th May 2004
Hi Agnes,

European style date.

I hope this helps?

Cor

\\\
Private Sub myroutine()
Mybinding = New Binding("Text", ds.Tables(0), "mydatfield")
textdatfield.DataBindings.Add(Mybinding)
AddHandler mybinding.Format, AddressOf DBdateTextbox
AddHandler mybinding.Parse, AddressOf TextBoxDBdate
End sub
Private Sub DBdateTextbox(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value Is DBNull.Value Then
cevent.Value = ""
Else
Dim datum As Date
datum = CDate(cevent.Value)
cevent.Value = datum.ToString("dd - MM - yyyy")
End If
End Sub
Private Sub TextBoxDBdate(ByVal sender As Object, _
ByVal cevent As ConvertEventArgs)
If cevent.Value.ToString = "" Then
cevent.Value = DBNull.Value
End If
End Sub
///


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding a textbox to current date arun@greettech.com Microsoft ASP .NET 5 2nd Jan 2007 09:22 PM
Binding date to textBox PawelR Microsoft C# .NET 3 3rd Feb 2005 12:02 PM
Format data in bound textbox as date Graeme Richardson Microsoft ADO .NET 2 10th Dec 2003 08:34 PM
Binding the date field to textbox Taras Microsoft Dot NET Framework 2 5th Oct 2003 06:30 AM
Binding the date field to textbox Taras Microsoft ADO .NET 2 5th Oct 2003 06:30 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:16 AM.