Hi,
I am using this code to populate data into combobox but i was just
thinking how can i assign an id to each item in the dropdown list like
the primary id for example because i want to save both id and name of
the company..
// fill the insurance company;
VDBAdapter.SelectCommand = new VistaDBCommand("SELECT account_name AS
insurance_account FROM accounts WHERE account_type = 'INSURANCE' ORDER
BY account_name", VDBConnection);
VDBDataset.Tables.Add("insurance_account");
VDBAdapter.Fill(VDBDataset, "insurance_account");
//put the data from the dataset into the combobox
DataTable tblInsuranceCompany = VDBDataset.Tables["insurance_account"];
if (oDataTable == null)
throw new Exception("BoxCustomers table not found in
oCustomersDataSet.");
foreach (DataRow oRow in tblInsuranceCompany.Rows)
{
cboInsurance.Items.Add(oRow["insurance_account"]);
}
Many Thanks,
Jassim Rahma
*** Sent via Developersdex http://www.developersdex.com ***