here is my code
my problem is when i try to show the timestamp i got this error "Conversion from type 'MySqlDateTime' to type 'String' is not valid." can any help me solve this thanks
Code:
Dim connStr As String = "Database=telcos;" & "Data Source=localhost;" & "User Id=root;Password=;" & "Allow Zero Datetime=True"
TextBox1.Text = Format(CDate(Now), "HH:mm:ss")
Dim tbl As DataSet
' Dim tbl2 As DataTable
Dim adapter As MySqlDataAdapter
' Dim ds As DataSet = New DataSet
Dim query As String = "SELECT timestamp FROM allmessage WHERE status='sent' ORDER BY ID DESC LIMIT 0, 1" '"SELECT * FROM sms_in ORDER BY" & "'pid' LIMIT 1"
Dim connection1 As New MySqlConnection(connStr)
Try
connection1.Open()
adapter = New MySqlDataAdapter(query, connection1)
tbl = New DataSet
adapter.Fill(tbl)
TextBox2.Text = tbl.Tables(0).Rows(0).Item("timestamp")
' TextBox25.Text = TextBox25.Text.Substring(10, 11)
Catch ex As MySqlException
Finally
connection1.Close()
End Try
End Sub