S
Sammut
Hi,
I am creating a comboform and trying to show a field from an access tables
but I cannot get how to tell the comboform what field from the table I want
to see
The access database is called "ecs"
The table I want is called "locality" and has 2 fields "Code" & "Text" nwo I
want to show the field text in my combo. This is my code so far but all I
get in my combo is a list of "System.Data.DataRowView".
OleDbConnection conn1 = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=d:\\cecs\\ecs.mdb");
conn1.Open();
//
System.Data.DataSet ds = new DataSet();
OleDbDataAdapter daLocality = new OleDbDataAdapter("select desc from
locality",conn1);
daLocality.Fill(ds,"Locality");
comboBox1.DataSource = ds.Tables["Locality"];
Any idea how to set what field I want to show.
Thanks
Ivan Sammut
I am creating a comboform and trying to show a field from an access tables
but I cannot get how to tell the comboform what field from the table I want
to see
The access database is called "ecs"
The table I want is called "locality" and has 2 fields "Code" & "Text" nwo I
want to show the field text in my combo. This is my code so far but all I
get in my combo is a list of "System.Data.DataRowView".
OleDbConnection conn1 = new
OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=d:\\cecs\\ecs.mdb");
conn1.Open();
//
System.Data.DataSet ds = new DataSet();
OleDbDataAdapter daLocality = new OleDbDataAdapter("select desc from
locality",conn1);
daLocality.Fill(ds,"Locality");
comboBox1.DataSource = ds.Tables["Locality"];
Any idea how to set what field I want to show.
Thanks
Ivan Sammut