Date Problem in SQL statement

zimzon

Member
Joined
Oct 31, 2006
Messages
13
Programming Experience
Beginner
hi,

i hav the following code which retrive the data from a mysql table.

VB.NET:
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
 
Using da As New MySqlDataAdapter
Using ds As New DataSet
 
da.SelectCommand = New MySqlCommand("SELECT * FROM xrates WHERE XRDate = #" & Me.XRateDateFrom.Value.Date & "# ORDER BY XRDate DESC", myCon)
 
da.Fill(ds)
Grid.DataSource = ds.Tables(0)
 
End Using
End Using
 
End Sub

i face the error at runtime, which is "Syntax error in SQL statement"..

what was wrong ... pls assist me.......
 
Last edited by a moderator:
Back
Top