| |

VerySource

 Forgot password?
 Register
Search
View: 1029|Reply: 7

Help bind the database in the GridView and update it?

[Copy link]

2

Threads

8

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-3 13:00:01
| Show all posts |Read mode
The database that I bind in the GridView has 3 tables, and the relationship between the 3 tables is as follows:
的 The fields in student include student number, name, class number, and professional number;
The fields in the table class include class and class number;
The fields in the table zhuanye have professional, professional number;
However, the columns I bind in the GridView are: student number name class professional
Now I want to update records in the GridView, how should I write the update statement?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 13:30:02
| Show all posts
Will it be updated after rebinding?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 13:45:01
| Show all posts
Re-execute the query and bind it to the control. In fact, it is the repeated execution of this piece of code
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-27 14:00:01
| Show all posts
Update three tables at the same time
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 14:15:01
| Show all posts
If the data has changed, refresh the page again, that is, rebind
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 14:30:01
| Show all posts
Update three tables, or write a stored procedure
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 14:45:02
| Show all posts
You can re-bind after updating the three tables at the same time
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-27 15:00:01
| Show all posts
Then you can first create a view on the three tables in the database, and then use this newly created view as a table.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list