bewa
May 6th, 2004, 02:49 AM
I'm learning C# and I'm writing a little DB application.
I've managed to get & display the first record, but how can I browse through the other records until EOF??? something like you could use in VB:
While not rs.EOF()
rs.Edit
rs!["Column"] = "Test"
rs.Update
rs.MoveNext
Wend
any help or links to pages that would allow me to do the same as above would be great.
Current code i have:
---------------------------------------------------------------------------
myAdap = new OleDbDataAdapter ("SELECT * FROM PERSONEEL", conn);
MyCommandBuilder = new OleDbCommandBuilder( myAdap );
myAdap.Fill( ds , "Personeel");
txtName.Text = ds.Tables["Personeel"].Rows[ 0 ]["Naam" ].ToString();
txtGivenname.Text = ds.Tables["Personeel"].Rows[ 0 ]["voornaam" ].ToString();
txtDOB.Text = ds.Tables["Personeel"].Rows[ 0 ]["GeboorteDatum"].ToString();
txtAddress.Text = ds.Tables["Personeel"].Rows[ 0 ]["Adres" ].ToString();
txtSalary.Text = ds.Tables["Personeel"].Rows[ 0 ]["Salaris" ].ToString();
---------------------------------------------------------------
I've managed to get & display the first record, but how can I browse through the other records until EOF??? something like you could use in VB:
While not rs.EOF()
rs.Edit
rs!["Column"] = "Test"
rs.Update
rs.MoveNext
Wend
any help or links to pages that would allow me to do the same as above would be great.
Current code i have:
---------------------------------------------------------------------------
myAdap = new OleDbDataAdapter ("SELECT * FROM PERSONEEL", conn);
MyCommandBuilder = new OleDbCommandBuilder( myAdap );
myAdap.Fill( ds , "Personeel");
txtName.Text = ds.Tables["Personeel"].Rows[ 0 ]["Naam" ].ToString();
txtGivenname.Text = ds.Tables["Personeel"].Rows[ 0 ]["voornaam" ].ToString();
txtDOB.Text = ds.Tables["Personeel"].Rows[ 0 ]["GeboorteDatum"].ToString();
txtAddress.Text = ds.Tables["Personeel"].Rows[ 0 ]["Adres" ].ToString();
txtSalary.Text = ds.Tables["Personeel"].Rows[ 0 ]["Salaris" ].ToString();
---------------------------------------------------------------