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

Recommended Answers

All 2 Replies

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

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.