开发者

binding multiple tables on one form in c#.NET

开发者 https://www.devze.com 2022-12-08 17:07 出处:网络
please this is kind of a beginners question. I have multiple tables like 5 tables related to each other in the database. I would like to create controls on a form in c# that will bind to different tab

please this is kind of a beginners question. I have multiple tables like 5 tables related to each other in the database. I would like to create controls on a form in c# that will bind to different tables though related and they will scroll together when I move to the next item. I am kind of confused on how to go about it.

I watched this vide开发者_运维技巧o i=on .net that showed me how to drag and drop from data source window onto the form but it does show me the code behind which I definitely don't understand.I would appreciate it if you can point me to a good tutorial I could follow step by step.

thanks


Use the BindingSource. if you say tables, you are probably using a DataSet. Bind the first binding source to the master table. Child tables you bind by specifying a second binding source whose data source points to the first. the DataMember of the 2nd source must be the DataSets's DataRelation that connects the two tables. The Windows Forms designer should help you in setting the properties correctly.

0

精彩评论

暂无评论...
验证码 换一张
取 消