GetdataBy date doesn't work Why?

Posted by vp789 on Stack Overflow See other posts from Stack Overflow or by vp789
Published on 2010-04-09T03:01:00Z Indexed on 2010/04/09 3:03 UTC
Read the original article Hit count: 243

Filed under:
|

I am trying to pull the data by date in vb.net. It is not throwing the error nor giving any result. Whereas It shows the results in table adapter configuration wizard when I try through query builder. I am using date time picker in the form. But I have formatted the date in the database as date.I am puzzled.

Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click

Try
    Dim dt As Date = CDate(tspTextDate.Text)          
    Me.Bank_transactionsTableAdapter.GetDataByDate(dt)

    'Catch ex As Exception
Catch ex As FormatException
    MessageBox.Show("date is  wrong", "Entry Error")
Catch ex As SqlException
    MessageBox.Show("SQL Server error#" & ex.Number _
                    & ":" & ex.Message, ex.GetType.ToString)

End Try

End Sub

rows of data

BT102 4/5/2010 BKS 200.00 1200.00 1400.00
BT103 4/5/2010 BKS 200.00 1400.00 1600.00
BT105 4/6/2010 BKS 200.00 1800.00 1800.00

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about database