![]() |
Click here to advertise with us
|
|
|||||||
| MySQL Discussion on using MySQL as a backend for VB.NET apps |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi hope someone can help me with this Please
I am using VB.NET and MySql What I have been try is write Date and read Date to and from the database I having problem formatting Date to the Textbox This is how I read from the database and I can not format the date nothing happend I get = 12.2.2010 00:00:00 try to format to = 12.02.2010 Code:
Txt_date.Text = (Format(rs.Fields("date").Value.ToString, "dd-mm-yyyy"))
This is how I write to the database Code:
Txt_date.Text = DateTime.Now.ToShortDateString
rs.Fields("date").Value = Txt_date.Text
Sigster |
|
|||
|
I am using a DataGridView to show data from a data base. Each data has a date stamp. The user is sellects the date in a DateTimePicker object.
The date format in the data base is dd/MM/yyyy. So I am doing this: Dim day As String = Me.DateTimePiCker.Value.ToString("dd/MM/yyyy") Dim sqlCommand As String = "SELECT * FROM matrix WHERE Date = """ & day & """ " I hope this helps |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|