I
Ivan Sammut
Hi,
I have just started using ADO so this question may look a
bit dump.
I created a query and everything works fine.
ListViewItem iItem = null;
OleDbConnection conn = new OleDbConnection
("Provider=Microsoft.Jet.OleDb.4.0; Data
Source=c:\\program files\\visual dataflex 8.2
\\bin\\pda\\pda.mdb");
OleDbCommand cmd = null;
OleDbDataReader rec1 = null;
conn.Open();
cmd = new OleDbCommand("select * from
pusers",conn);
rec1 = cmd.ExecuteReader();
while (rec1.Read())
{
iItem = new ListViewItem();
iItem.Text = rec1.GetValue(1).ToString
();
listView1.Items.Add(iItem);
}
The problem is this line "iItem.Text = rec1.GetValue
(1).ToString();"
is there a way by which instead of a field index I can use
the field name??
Thanks
Ivan Sammut
I have just started using ADO so this question may look a
bit dump.
I created a query and everything works fine.
ListViewItem iItem = null;
OleDbConnection conn = new OleDbConnection
("Provider=Microsoft.Jet.OleDb.4.0; Data
Source=c:\\program files\\visual dataflex 8.2
\\bin\\pda\\pda.mdb");
OleDbCommand cmd = null;
OleDbDataReader rec1 = null;
conn.Open();
cmd = new OleDbCommand("select * from
pusers",conn);
rec1 = cmd.ExecuteReader();
while (rec1.Read())
{
iItem = new ListViewItem();
iItem.Text = rec1.GetValue(1).ToString
();
listView1.Items.Add(iItem);
}
The problem is this line "iItem.Text = rec1.GetValue
(1).ToString();"
is there a way by which instead of a field index I can use
the field name??
Thanks
Ivan Sammut