0

Hi,
I try to do a winform C# (2005) and update an item in Grid.
The 1st column, I have a combobox so I want update all item in Grid when I change value in comboboxes.
Could everyone give me an example? Thanks in adv

4
Contributors
4
Replies
5
Views
9 Years
Discussion Span
Last Post by ChaseVoid
0

Thanks Amir S.Bedair

That is usefull for me, I will read and try to do my problems, if I have any question I will reply you for helping.

0

I try to do a winform C# (2005) and update an item in Grid.
The 1st column, I have a combobox so I want update all item in Grid when I change value in comboboxes.
Could everyone give me an example? Thanks in adv

example:

/* databasename to sql=behdari
tabelname to sql=tblshagel */
string SQLCON = "SERVER=(LOCAL);DATABASE=BEHDARI;iNTEGRATED
SECURITY=TRUE;";
string strSQL = string.Format("SELECT * FROM tblSHaghel WHERE family
LIKE'%{0}%'", combobox1.Text);
behdariDataSet1.tblSHaghel.Clear();
SqlDataAdapter dadp = new SqlDataAdapter(strSQL, SQLCON);
dadp.Fill(behdariDataSet3.tblSHaghel);

Edited by happygeek: fixed formatting

0

You can use the ComboBox class SelectedIndexChanged or SelectedValueChanged Events. Once the event is generated, you can update the DataSet and then display the data in the DataGrid.

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.