Home > Net >  The gridview binding more data
The gridview binding more data

Time:09-19




As shown in figure, the gridview background need to bind multiple tables of multiple fields, how to operate the


The delivery information table: the order number, invoice number, customer ID, the delivery date

Delivery product table: the order number, product ID, delivery amount, delivery quantity, net weight, delivery shipment gross


Contract information table: the order number, a salesman, the contract signing date, the contract for the record date



The gridview background how to bind to multiple data sheet

CodePudding user response:

You should consider how to set the SQL table relationships found out more

CodePudding user response:

reference 1st floor ManBOyyy response:
you should consider how to set the SQL table relationships found out more line


Then as long as add column will change the SQL, it is not very trouble to maintain

CodePudding user response:

Customer ID you need from the customer information list out the customer name, the salesman ID from the employee information table names

CodePudding user response:

Is there good way

CodePudding user response:

Do need associated table view, provide the GridView displays

CodePudding user response:

reference 5 floor EdsionWang reply:
do need associated table view, provide the GridView show


Involves five table here, this is in trouble

CodePudding user response:

The federated query

CodePudding user response:

It is best to view and update column also launch

CodePudding user response:

Tables are related data source is only one.

So all you need is "integration of a data source" rather than "bind multiple data sources"

CodePudding user response:

Did not come in the Datatable finally need to bind data together to a Datatable to the gridview or SQL associated to check all the same

CodePudding user response:

Federated query, data needed for all found out, on a DataSet, and directly assigned to control line

CodePudding user response:

refer to the second floor snlixing response:
Quote: refer to 1st floor ManBOyyy response:

You should consider how to set the SQL table relationships found out more line


Then as long as add column will change the SQL, the maintenance is very troublesome

To maintain what's the trouble? Just change the SQL query under went, if use other ways to do it, when the new columns you are want to modify the client code, do more harm than good,
For your question, generally is two kinds of solutions,
The first kind, multi-table LianZha, fetch the data from the database when you need, this to implement and easy,
Second, the client joining together the datatable, do as you say, take five table data, and then a new table in Mosaic is bound to the datagridview, the more trouble,
Regardless of datagridview can bind multiple data sources, even if can bind, don't trouble you deal with? Your five table must have the same field, it impossible to get the same fields appear on the datagridview,
  • Related