Thanks for the quick response.
I made the ExecuteScalar change and still didn't get the highest number.
My query stopped at 114,278, row 114,279 is empty yet 114,300 isn't.
"Kelly Herald" wrote:
Change the ExecuteNonQuery to ExecuteScalar and casting it to an Int32.
"segue" <se***@discussions.microsoft.comwrote in message
news:1D**********************************@microsof t.com...
The below code doesn't give me the last record count.
Feedback very appreciated. Thanks for all that you do.
qstring = "SELECT COUNT(*) FROM CustomerInformation "
Dim newSql As New SqlConnection(connectionstr)
newSql.Open()
Dim catCMD As SqlCommand = newSql.CreateCommand()
catCMD.CommandText = qstring
Dim intRecordsAffected = catCMD.ExecuteNonQuery()
newSql.Close()