Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to display text from datareader field
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00672730
Message ID:
00672735
Vues:
6
The purpose of the ExecuteReader method is to create the DataReader object. The Read method of the DataReader fetches the next record. Most of the time you find the Read method in a Do While clause to get the next record. The ExecuteReader does not fetch the first record but allows the developer to control when and how that process is to occur.

>Thanks Cathi! That worked.
>
>Seems redundant that you need a "reader.read()" statement thats preceeded by an "ExecuteReader()" statement...
>
>Todd
>
>
>>You need to call the Read method of the DataReader before accessing the data. The Read method actually goes out and fetches the record. Change your code to the following:
>
>Dim reader As System.Data.OleDb.OleDbDataReader
>reader = OleDbCommand1.ExecuteReader()
>reader.Read()
>TextBox4.Text() = reader.Item("hdesc")
-----------------------------------------

Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.com
www.prenia.com
Weblog: blogs.prenia.com/cathi
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform