Welcome to the Visual Studio General Discussion Forum

hi..

i've been using vb6.0 to develop applications. we just switched to visual studio 2003 .net..

i have the following code in vb6.0

Do While Not RSDetail.EOF
If RSDetail.Fields("itemno") = vItem Then
vQty = vQty + RSDetail.Fields("Qty")
RSDetail.MoveNext
Else
vSearcher = "ActCode = '" + vItem + "'"
RSActTBL.MoveFirst
RSActTBL.Find vSearcher
If Not RSActTBL.EOF Then
vAmt = RSActTBL.Fields("ActAmount").Value
vSubgroup = RSActTBL.Fields("Subgrouper")
Endif
end if
loop

how to re-code this in VS .NET 2003? i cant use
vAmt = RSActTBL.Fields("ActAmount").Value
anymore.. so anyone can give me an idea how to re-code this in the VS .NET 2003

thanks and best regards
marc

[774 byte] By [chrom] at [2008-2-15]
# 1
Hi,
First of all you'll have to learn ADO .net. Coz ADO and ADO .net has a huge difference. To access a field you could just use, myDataReader("<fieldname>") and convert it to your specified type...

In your code I think you'll have to use a DataTable since you can't achieve that using a DataReader coz you've got some movefirst statement and readers are forward-only cursors...

Take a look at this functions/Classes, Im sure it can help you...

Dataset
DataTable
DataRow
DataRow.Find() - Search For Primary key Record...
cheers,
Paul June A. Domag

PaulDomag at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic Language...