在我的代码中DR.HasRows()
返回True
,但在SQL Management Studio 中工作时DR("LastID")
返回。DBNUll
SELECT IDENT_CURRENT ('SiteSection') AS 'LastID'
__SQLString= "SELECT IDENT_CURRENT ('SiteSection') AS 'LastID'"
Dim DR As SqlDataReader
ddConnect() 'It's my custom class that opens a connection to db, it works
DR = ddExecuteReader()
DR.Read()
If DR.HasRows() Then
GetLastID = DR("LastID")
End If