C
Claudia Fong
Hi,
I have a form where I need to display the data of a department that
stores in a access db.
When I first load the form it will call a function name loaddata which
will get the first record from the db and then display for the user:
oleDbConnection1.Open();
OleDbDataReader objReader = objdisplay.ExecuteReader(); --> this will
select DEPT_CODE,DEPT_NAME,DEPT_ATTN FROM DEP_TABLE
if (objReader.HasRows)
{
objReader.Read();
textBox1.Text = Convert.ToString(objReader["DEPT_CODE"]);
textBox2.Text = Convert.ToString(objReader["DEPT_NAME"]);
textBox3.Text = Convert.ToString(objReader["DEPT_ATTN"]);
(...)
Then I have various button, one of them is NEXT, which I want to read
the next record from the db. I'm new in C# and in VB, I will use the
MoveNext to move to the next record, but is it the same in C#?
Can someone help me?
Cheers!
Claudi
I have a form where I need to display the data of a department that
stores in a access db.
When I first load the form it will call a function name loaddata which
will get the first record from the db and then display for the user:
oleDbConnection1.Open();
OleDbDataReader objReader = objdisplay.ExecuteReader(); --> this will
select DEPT_CODE,DEPT_NAME,DEPT_ATTN FROM DEP_TABLE
if (objReader.HasRows)
{
objReader.Read();
textBox1.Text = Convert.ToString(objReader["DEPT_CODE"]);
textBox2.Text = Convert.ToString(objReader["DEPT_NAME"]);
textBox3.Text = Convert.ToString(objReader["DEPT_ATTN"]);
(...)
Then I have various button, one of them is NEXT, which I want to read
the next record from the db. I'm new in C# and in VB, I will use the
MoveNext to move to the next record, but is it the same in C#?
Can someone help me?
Cheers!
Claudi