Hi there!
How can i bind between two forms ,the base form has a data set &
I want to bind this data to second form in a list box??
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
JouePosted Sep 10, 2005, 7:02 AM
Thanks
Andrzej WegierskiPosted Sep 9, 2005, 5:59 AM
ArrayList myArray=new ArrayList(1);
foreach(DataRow dr in myTable.Rows)
{
myArray.Add(dr["myColumn"]);
}
myCombo.DataSource=myArray;
Not tested.
JouePosted Sep 8, 2005, 6:19 AM
write it's values to array list or array an use array as source. ??
Forgive me ,I'm a beginner
Thanks
Andrzej WegierskiPosted Sep 8, 2005, 2:40 AM
JouePosted Sep 8, 2005, 1:34 AM
I tried another way but need help: I defined ComboBox as public in its form (second)
& in the first form I created an object(J) from second form & wrote this in suitable place:
J.MyComboBox.DataSource=myDataSet1.Joue;
J.ShowDialog();
After debuging I found this in comboBox:System.Data.DataRowView
So,what do you think?
Thanks
JouePosted Sep 8, 2005, 12:58 AM
I created a DataSet property ,as you said,in second form after i have
define dataset as public in first & I worte this statement in Load event
of second form:MyComboBox.DataSource=myDataSet1.Joue;
when debuging ,I found nothing in MyComboBox!!
Thanks again.
Andrzej WegierskiPosted Sep 6, 2005, 6:34 AM