By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,570 Members | 1,613 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,570 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
Hi Agnes,

European style date.

I hope this helps?


Private Sub myroutine()
Mybinding = New Binding("Text", ds.Tables(0), "mydatfield")
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 = ""
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
Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.