List Info

Thread: Re: DataTable




Re: DataTable
country flaguser name
United States
2007-10-03 20:57:57

Andres

Sounds very promising.. will give my buddy the
news and give you a report. Thanks muchly.

Spoo

--- In VisualBasic_Official%40yahoogroups.com">VisualBasic_Officialyahoogroups.com, "Andres Pineda"
<pineda.andres...> wrote:
&gt;
> DataTable has a propierty called Rows.
&gt;
> Imagine you got this:
&gt;
> oTable as your table already filled with the data. So you do this:
&gt;
> oTable.Rows(0)(0) this will give you the value of the Row 1 Colum 1
> oTable.Rows(1)(0) this will give you the value of the Row 2 Colum 1
> oTable.Rows(1)(2) this will give you the value of the Row 2 Colum 2
>
> and so On...
&gt;
> It's like a two-dimension array the 1st array gives you the Rows
and the 2nd
> one the Colums
&gt;
> Hope this help.-
&gt;
>
>
> On 10/2/07, spooboy54 <spooboy54...> wrote:
&gt;
> > Guys
>; >
>; > A buddy of mine is working with .Net (poor guy --
> > hehe, sorry, I'm a VB6 kinda guy). He has populated
> > a datatable.. it was initialized with the following...
> >
>; > Dim MyDT as New DataTable
> >
>; > It is then populated using...
> >
>; > Dim dataadapter As New SqlDataAdapter(testCommmand)
> > dataadapter.Fill(MyDT)
> >
>; > I've left out the connection code.. assume that MyDT
>; > is populated. Here is the question:
> >
>; > How would he read the value of record 1, field 1,
> > and stick it in a variable v1. Then, how would
&gt; > he advance to record 2, field 1, and do same?
&gt; >
>; > Using Access and VB6, I'd do something like this:
&gt; >
>; > Dim MyRS as Recordset
> > <code to populate the table>
> > MyRS.MoveFirst
> > v1 = MyRS(";MyField&quot;)
>; > MyRS.MoveNext
> > v1 = MyRS(";MyField&quot;)
>; >
>; > Pretty easy with Access and VB6.
>; > How does one do that in .Net?
&gt; >
>; > Spoo
>; >
>; >
> >
>;
>
> [Non-text portions of this message have been removed]
>

__._,_.___
.

__,_._,___
[1]

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