Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

Sql database tables that has relationships to datagridviewcombobox

$
0
0

This is my database diagram;

project <--------∞ maingroup <--------------∞ group<------------∞  product<--------∞ piece
*proID                *maingroupId                      *groupId                 *productId           *pieceId
  name                 name                                   name                     name                    name
                         +proId                                 +maingrupId           +groupId             +productId       

*primarykey  

and my code for sql database to datagridview is;

using (ALBAYRAKEntities db = new ALBAYRAKEntities())
            {
                pROJEBindingSource.DataSource = db.PROJEs.ToList();
                aNAGRUPBindingSource.DataSource = db.ANAGRUPs.ToList();
                gRUPPBindingSource.DataSource = db.GRUPPs.ToList();üRÜNNBindingSource.DataSource = db.ÜRÜNN.ToList();
                aLTPARCABindingSource.DataSource = db.ALTPARCAs.ToList();
            }

But

I want to retrieve data from the database to datagridview; second column according to the selected item in the first column and the third column according to selected item in the second column and so on, according to sql relationship.

How can I do this?

Thanks in advance.


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>