You can either translate it at an SQL level,
http://whatiseeinit.blogspot.com/2012/02/conversion-of-dates-in-sql.html

Or else at a .Net level,
http://www.geekzilla.co.uk/View00FF7904-B510-468C-A2C8-F859AA20581F.htm

Whatever you do, do not do it manually by altering strings.

On 29 February 2012 18:22, Eddy Wu <eddyw...@gmail.com> wrote:

> my project contains one DateTimePicker, one Button and a ListBox. each
> time the user click the button then the *date string* value would pass in
> the ListBox Control, I had declared one User Defined Function named
> "GetSQLRawFormattedDate(ByVal SDate As String) As String" to handled the
> reverse order of the character string representation of the *Date String*from 
> right to left so it would looks like "20120301", I think this
> formatted *datestring* can then be pass to the MySql table structure, but
> unfortunately it ran to did not any changes to the result as I expected
> before.
>
> please examine the code snippet I had done so far :
> ............................................
> ............................................
> ............................................
>
> // The Trigger Section
>  Private Sub BtnParser_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles BtnParser.Click
>         Dim strdate As String = DateTimePicker1.Value.ToShortDateString
>         Dim sqlformstr As String = GetSQLRawFormattedDate(strdate.Trim)
>
>         ListBox1.Items.Add(sqlformstr)
>
>     End Sub
>
> Private Function GetSQLRawFormattedDate(ByVal SDate As String) As String
>         Dim tempStr As String = SDate
>         Dim retStr As String = Nothing
>
>         For n As Integer = tempStr.Length - 1 To 0
>             If (tempStr.Chars(n) <> "/"c) Or (tempStr.Chars(n) <> "-"c)
> Then
>                 retStr &= String.Concat("", tempStr(n))
>             End If
>         Next
>
>         Return tempStr.Trim
>     End Function
>
> but still didn't show any positive changes, please help ...
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to dotnetdevelopment@googlegroups.com
> To unsubscribe from this group, send email to
> dotnetdevelopment+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to dotnetdevelopment@googlegroups.com
To unsubscribe from this group, send email to
dotnetdevelopment+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to