Im using binding source, which is by setting the data binding properties of each text box to display data at textbox from database, Me.PaymentTableAdapter.Fill(Me.RestaurantDataSet.Payment)
Can i know how to format date and time, for example 04 Jan 2020 and 23:00 displayed at textbox? The default displaying style is 2020/01/04 and 23:00:00
I have searched through google but none of the solutions working
I just tested the following code and it worked as expected:
I used four
TextBoxes- two without formatting and two with. As you can see, I provided only the basic information when binding the unformattedTextBoxesbut used an overload ofAddwith more parameters in order to specify that formatting was enabled and what the format should be when binding the formattedTextBoxes. In order to provide a format string, you must also provide a data source update mode and a null value. In this case, I have specified the default values for each. If you don't want to have to specify those values then you could go back to the more basic overload and then set the other required properties after creation:Note that, if your time data is type
Dateas well, the principle is still the same. You simply use a different format string: