N
_nabuchodonozor
Hi,
I want to set value for combobox but without creators only code. I
want to set "titles" from tabel "films". I did something like this:
int limit=0; // how
many films I have in table
string qry = "select Title from films";
SqlDataAdapter dataAdapter = new SqlDataAdapter(qry,
conNW);
SqlCommand cmdFilm = new SqlCommand(qry, conNW);
conNW.Open();
limit = cmdFilm.ExecuteNonQuery(); // get number of films
conNW.Close();
SqlCommandBuilder commandBuilder = new
SqlCommandBuilder(dataAdapter);
DataTable table = new DataTable();
table.Locale =
System.Globalization.CultureInfo.InvariantCulture;
dataAdapter.Fill(table);
for (int i = 0; i < limit; i++) // set value for combo
{
comboBoxWybFilm.ValueMember = table.Rows
[0].ToString();
}
it doesnt work what I should do?? how to set combo?? Do you have
better ideas??
I want to set value for combobox but without creators only code. I
want to set "titles" from tabel "films". I did something like this:
int limit=0; // how
many films I have in table
string qry = "select Title from films";
SqlDataAdapter dataAdapter = new SqlDataAdapter(qry,
conNW);
SqlCommand cmdFilm = new SqlCommand(qry, conNW);
conNW.Open();
limit = cmdFilm.ExecuteNonQuery(); // get number of films
conNW.Close();
SqlCommandBuilder commandBuilder = new
SqlCommandBuilder(dataAdapter);
DataTable table = new DataTable();
table.Locale =
System.Globalization.CultureInfo.InvariantCulture;
dataAdapter.Fill(table);
for (int i = 0; i < limit; i++) // set value for combo
{
comboBoxWybFilm.ValueMember = table.Rows
[0].ToString();
}
it doesnt work what I should do?? how to set combo?? Do you have
better ideas??