AOA,
Just started working with .NET and i'm need to find a solution to loop through a DataSet. In VB6, we used to write following code to fill-up a recordset with table data and can loop through all the records with a Do-While loop
PHP Code:
Dim rs As New ADODB.Recordset
rs.Open "SELECT * FROM MyTable", conn, adOpenForwardOnly, adLockReadOnly
Do While Not rs.EOF
Debug.Print rs.Fields("Users").Value & " : " & rs.Fields("Pwd").Value
rs.MoveNext
Loop
rs.Close
In C#, i can fill-up a DataSet with table data, but I want to walk through all the rows in same way as i can do in VB6... how would i acheive that??
PHP Code:
SqlConnection con = new SqlConnection(sConnection);
DataSet ds = new DataSet();
SqlDataAdapter adapt = new SqlDataAdapter("SELECT * FROM MyTable", con);
adapt.Fill(ds);
Thanks in advance.