cmd.ExecuteScalar()
That's for updating a database table without asking for any information back
You have to create a reader object, that will read the response back, and feed your command object into the reader.
myConnection.Open()
Dim myReader As SqlDataReader = myCommand.ExecuteReader()
Dim FieldCount As Integer = myReader.FieldCount
While myReader.Read()
m_count = myReader.GetString(0)
End While
if (m_Count > 0) then
httpcontext.current.response.redirect("home.aspx")
end if