Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executereader has no records
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01501091
Message ID:
01501092
Vues:
38
>I have code like:
> OleDbDataReader rdrCount = cmdCount.ExecuteReader();
> and a while (rdrCount.Read())
>
>The rdrCount just has a Select String
>
>Now the rdrCount.HasRows returns true, but the rdrCount.recordsAffected returns -1
>...and in my reader loop I get an InvalidOperation exception from a ..
> x=Convert.ToInt32(Convert.ToDouble(rdrCount["CALLS"].ToString().Trim()))
>
>Would the recordsAffected not return a positive number if the HasRows is true ?
>Also, I cant seem to see anywhere in debug the column data in rdrCount
>(I suspect this is because the rdrCount["CALLS"] has an unexpected data type in there)
> but where can is see rdrCount["CALLS"] in debug mode

I think RowAffected is always -1 for a Select.
What does a simple rdrCount["CALLS"].ToString() show?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform