0

hi,

I would like to load data from sql to datagrid. But there is a problem at highlighted place.

Sql = "Select [KioskID] As [KioskID], " _
            & "[KioskLocation] As [KioskLocation], " _
            & "[TransactionNo] As [TransactionNo], " _
        & "[SerialNo] As [SerialNo], " _
        & "[TransactionDateTime] As [TransactionDateTime], " _
        & "[TransactionDate] As [TransactionDate], " _
        & "[TransactionTime] As [TransactionTime], " _
        & "[TransactionCode] As [TransactionCode], " _
        & "[AgencyCode] As [AgencyCode], " _
        & "[AgencyName] As [AgencyName], " _
        & "[AccountNo] As [AccountNo], " _
        & "[BillNo] As [BillNo], " _
        & "[BillAmount] As [BillAmount], " _
         & "[PaidAmount] As [PaidAmount] " _
        & "From Update_IServeManualTrans " _
        & "where TransactionDate = '" & FromDate.ToString & "' " _
        & "And TransactionDate = '" & ToDate.ToString & "' "

my data structure in sql database is like this =>
TransactionDate nvarchar(11) Checked
TransactionTime nvarchar(11) Checked


how do i overcome this problem. I have no idea on how to convert the date. Please help

3
Contributors
2
Replies
3
Views
6 Years
Discussion Span
Last Post by Netcode
0

where and how you define FromDate and ToDate?
also are you sure about your Where clause? i dont think it will ever return something since u check the same field for two different values

0

what are your 'Fromdate' and 'ToDate'? are they controls like textboxes indicating a date value or something else.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.