Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where's SqlDataReader.Item ??
Message
De
28/06/2004 13:16:41
 
 
À
28/06/2004 13:07:37
Information générale
Forum:
ASP.NET
Catégorie:
ADO.NET
Divers
Thread ID:
00918060
Message ID:
00918065
Vues:
8
I haven't used DataReaders, but I suspect your problem is in the syntax. I think you need the square brackets (I'm assuming you're using C#):
dr.Item["Unqkey"]; 
~~Bonnie

>I am using a SqlDataReader to retrieve SQL Server data. The datareader is reported to have a public Item property, but I can't access it. I see example after example using the Item property, but it does not show in intellisense for me. I am using dr.GetInt32(dr.GetOrdinal("UnqKey")) instead of simply dr("Unqkey") or dr.Item("Unqkey"). When I use the latter, I get the message 'dr' denotes a variable where a 'method' was expected.
>
>Any idea what's going on? Thanks.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform