| |

VerySource

 Forgot password?
 Register
Search
View: 650|Reply: 1

What is the difference between these two methods when binding data? ?

[Copy link]

3

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-16 02:20:01
| Show all posts |Read mode
One:
da.fill (ds);
this.dg.DataSource = ds;

two:
da.fill (ds, "tab");
this.dg.DataSource = ds.Table ["tab"];

What is the difference between the two, which is better? ?
Reply

Use magic Report

0

Threads

41

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-21 17:27:01
| Show all posts
No difference, just add a table name
If there are multiple tables in a dataset
You can add an alias to each table inside to distinguish

If a table is accessed using dataset.Table [0], the effect is the same
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