ExecuteScalar()
returns only a single value:
Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
if you select more than one field you need to use ExecuteReader()
Something like that should work:
For Each row As DataRow In ds.Tables("choices").Rows
Dim cmdAns As New SqlCommand("select count(*),...candidateid=@cid", cnn)
Dim pCid As New SqlParameter("@cid", row("candidateid"))
cmdAns.Parameters.Add(pCid)
Dim data As SqlDataReader
data = command.ExecuteReader()
While data.Read
If data.HasRows = True Then
Dim count As String = data(0)
Dim pct As String = data(1)
row("CandidateName") = row("CandidateName") & " - " & count & "(" & pct & ") %"
End If
End While
Next