Home > Net >  Student course management system for help, I'm sorry brothers no points at the bosses to help m
Student course management system for help, I'm sorry brothers no points at the bosses to help m

Time:05-25

How the database is part of the data between two or three different tables loaded into the datagridview displayed

CodePudding user response:

Select a. *, b., c. * * from xx on Anderson, a left join ss b d=b.i d left on b.i join yy c d=c.i d
And then the corresponding column DGV field identifier into a corresponding database field name

CodePudding user response:

Join queries found out, or we made a few collections

CodePudding user response:

Make a view database
Or queries using the join
Can find multiple tables in a query of the field to the same datatable
Don't bother, you can use code generation a datatable, again through The Times of different table to query the database to check data, then fill the data into the generated inside the datatable

CodePudding user response:

Take a look at the two or three tables directly if there is any logical connection, if there is a logical connection to display all the information in these tables around outside, in the form of contact if there is no single save result set take collection with the union,
1. The logical relationship between the following SQL to oracle writing
Students table table
Student ID, student name and student ID result
Xiao Ming, 0001, 98 0001
0002 small red 0002 95
- here is student table table
Select * from students table, table table where students. Student ID=result tables. Student ID (+)
2. There is no logical relationship between the following SQL to oracle writing
Student achievement table teacher performance table
Student ID students name grade teacher ID name
0001 98, 0001, zhang wei xiao Ming 100
Select * from student achievement table
Union all
Select * from teacher score








CodePudding user response:

Thank you my friends thank you

CodePudding user response:

cabbage vegetables chicken reference 4 floor response:
take a look at the two or three tables directly if there is any logical connection, if there is a logical link need to display all the information in these tables around outside, in the form of contact if there is no single save result set take collection with the union,
1. The logical relationship between the following SQL to oracle writing
Students table table
Student ID, student name and student ID result
Xiao Ming, 0001, 98 0001
0002 small red 0002 95
- here is student table table
Select * from students table, table table where students. Student ID=result tables. Student ID (+)
2. There is no logical relationship between the following SQL to oracle writing
Student achievement table teacher performance table
Student ID students name grade teacher ID name
0001 98, 0001, zhang wei xiao Ming 100
Select * from student achievement table
Union all
Select * from the teacher score
this method is very simple and quite practical thank you bosses

CodePudding user response:

The
oh wow reference 3 floor response:

database do a viewOr queries using the join
Can find multiple tables in a query of the field to the same datatable
Don't bother, you can use code generation a datatable, again through The Times of different table to query the database to check data, then fill the data into the generated inside the datatable
I haven't tried to try this method

CodePudding user response:

This is too simple, three solutions:
1, if there is no transfer conditions,
Can directly use the Create View design a set of views, and then through the UI to invoke it, access to the DataTable,

2, if there are arguments:
Can consider to use stored procedures,

3, the most intuitive and efficient way, is to use an ORM framework, such as EntityFramework,
Write directly on the front end DAL layer, LINQ or Labmbda expression to implement query logic, output to the List Or IList Turn the DataTable, is very convenient,

And, of course, there is a kind of traditional three layers, that is on the front end to write SQL script, data access layer to perform in the DataTable output, this way once very popular, but it is complex to grammar, spelling, readability is poor, but prone to SQL injection attacks, more and more being abandoned,
  •  Tags:  
  • C#
  • Related