Selct command for Time stamp in VB.NET RRS feed

  • Question

  • User-1578974752 posted

    In the Test MASTER TABLE,I have lot of recorde under 1 emailid. I want to see the emailid with timetaken NUll. Time taken is having Time7 datatype in sql. when it reaches if val(x)="" then,error is throwing. Appreciate the help

    Try cmd = New SqlCommand

    cmd.Connection = con

    cmd.CommandText = "select * from TestMaster where EmailID='" + txtUsername.Text.ToString + "'"

    drd = cmd.ExecuteReader

    dim flag as integer

    Dim x As TimeSpan FLAG = 0

    If drd.HasRows = True

    Then drd.Read()

    While drd.Read

    x = drd.Item("Timetaken")

    if val(x)="" then

    FLAG = 1

    End if

    End While

    'Else ' novalue.Text = 1

    'End If

    End If

    Catch ex As Exception




    End Try

    Thursday, May 30, 2019 8:36 AM


  • User-1578974752 posted

    Issue was with the Timestamp field. Instead of that,I used the Result field and working fine

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 31, 2019 3:20 AM