0

i work with C#.net and mysql.

i will fill a combo box with data from stored procedure.
but i get only 1 value.

how can i fill the combobox?

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by tchiloh
0

>how can i fill the combobox?

Two ways:

1. DataBinding

2. Use Items collection to add list items.

0

i don't found something about databinding or items collection for stored procedures with c#.

0

Steps:

1. Populate the datatable instance using DataAdapter's Fill method.
2. Set DataSource, DisplayMember, and ValueMember properties.

comboBox1.DataSource=dataTab_instance;
 comboBox1.DisplayMember="column_name1";
 comboBox1.ValueMember="column_name1";
0

Steps:

1. Populate the datatable instance using DataAdapter's Fill method.
2. Set DataSource, DisplayMember, and ValueMember properties.

comboBox1.DataSource=dataTab_instance;
 comboBox1.DisplayMember="column_name1";
 comboBox1.ValueMember="column_name1";

for stored procedures i don't have DataAdpter.
i have:

MySqlConnection connection = new MySqlConnection(@"User ID=root;Password=oursupport;Host=192.168.1.25;Port=3306;Database=test; Direct=true;Protocol=TCP;Compress=false;Pooling=true;Min Pool Size=0;Max Pool Size=100;Connection Lifetime=0;");
                MySqlCommand command = connection.CreateCommand();
                MySqlDataReader Reader;
                connection.CreateCommand();

                command.CommandType = System.Data.CommandType.StoredProcedure;
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.