I am trying to access one colum in one row in a SQL Database.
Dim qryDraw As String = "SELECT LastDD FROM dbo.comDate Where DrawNo = 2 "
Dim cmdDraw As New SqlCommand(qryDraw, Connection)
Dim pagesize As Long = 0
Dim adpDraw As SqlDataAdapter = New SqlDataAdapter(qryDraw, Connection)
Dim dataSet As DataSet = New DataSet()
Dim reader As SqlDataReader = cmdDraw.ExecuteReader
'adpDraw.Fill(dataSet, pagesize, 1, "comDate")
If reader.HasRows Then
Dim last As Long = LastDD
End If
reader.Close()
Return LastDD
I am at my wits end on this, it seemed so simple but this little routine does not return what it should. LastDD should return a Date.Tick which is around 14 to 20 integers long this does not. I have tried adapter. fill, the data reader does nothing what am I doing wrong?
All i want is to pull one value from a database to use in a calculation.
in another routine please help me