List Info

Thread: Please help: How to Traverse a Dataset using VB.NET




Please help: How to Traverse a Dataset using VB.NET
country flaguser name
United States
2007-09-27 14:36:25

Hi, all.

I could not find reference on how to traverse a Dataset in VB.NET like I
used to do with the recordsets in classic ASP.

Can anybody give me a hand (or a code sample) for that?

In other words, I want to perform this in VB.NET:

Classic ASP (recordset):
while not RS.EOF
response.write (RS("category_name"))
RS.MoveNext
wend
RS.Close

VB.NET (dataset):
????

Thanks in advance for any tip.

All the best,
Pedro.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: Please help: How to Traverse a Dataset using VB.NET
country flaguser name
United States
2007-09-27 14:41:34

Hi Pedro,

I strongly suggest downloading Reflector if you don't have it (
http://www.aisto.com/roeder/dotnet ). This will allow you to browse all
classes and attributes of the .NET framework at will, and even look at
disassembled code.

In short, a DataSet contains a collection of DataTable objects, which you
can traverse to find the correct table. Once there, you can roam among the
selected DataTable's Rows collection, each member of which has a Columns
collection, etc.

Really, though, if you just want to display a column from the default
view of a DataSet, why not just bind it to a DataGrid/GridView or a
Repeater?

Peter

On 9/27/07, Pedro Carneiro < pedro.carneiro%40agehab.go.gov.br">pedro.carneiroagehab.go.gov.br&gt; wrote:
&gt;
> Hi, all.
>;
> I could not find reference on how to traverse a Dataset in VB.NET like I
> used to do with the recordsets in classic ASP.
>;
> Can anybody give me a hand (or a code sample) for that?
&gt;
> In other words, I want to perform this in VB.NET:
>
> Classic ASP (recordset):
> while not RS.EOF
&gt; response.write (RS("category_name"))
> RS.MoveNext
> wend
>; RS.Close
>
>; VB.NET (dataset):
> ????
>;
> Thanks in advance for any tip.
>;
> All the best,
&gt; Pedro.
&gt;

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity
Visit Your Group
Y! Messenger

Group get-together

Host a free online

conference on IM.

Search Ads

Get new customers.

List your web site

in Yahoo! Search.

Find Enlightenment

Yoga groups and

resources on

Yahoo! Groups.

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )