| |

VerySource

 Forgot password?
 Register
Search
View: 728|Reply: 8

Question about simple binding

[Copy link]

3

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-1-21 10:00:02
| Show all posts |Read mode
Look at the following data:
 Use "DataList" to bind "Department" and "Total Score" to the database. "Order" is not bound. It should be displayed as: first place ... second place ...

Rank Department Total
 
Rank Other 79
 
Rank Biochemical Engineering 69
 
Ranking Department of Computer Science 67
 
Rank Hospital Office 65
 
Rank Department of Basic Science 64
 
Ranking Department of Economic Management 63
 
Ranking Department of Mechanical Engineering 57
 
Rank Electrical Engineering 56
 

The final result can be displayed like this:

Rank Department Total
 
1st Other 79
 
2nd Department of Biochemical Engineering 69
 
3rd Department of Computer Science 67
 
4th Place Office 65
 
5th Place: Department of Basic Science 64
 
6th Department of Economic Management 63
 
7th Department of Mechanical Engineering 57
 
8th Department of Electrical Engineering 56
Reply

Use magic Report

3

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

 Author| Post time: 2020-1-31 01:18:01
| Show all posts
Does anyone know
Reply

Use magic Report

1

Threads

10

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-31 01:36:02
| Show all posts
Rankings can be added dynamically to bind. . .
Reply

Use magic Report

1

Threads

10

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-31 08:18:01
| Show all posts
Assume after connecting to the database to generate a dataset for ds
 DataSet ds;
        ds.Tables [""]. Columns.Add ("rank");
        for (int i = 0; i <ds.Tables [""]. Rows.Count; i ++)
        {
            ds.Tables [""]. Rows [i] ["Name"] = "No." + Convert.ToString (i + 1) + "Name";
        }
        DataList1.DataSource = ds.Tables [""];
        DataList1.DataBind ();
Reply

Use magic Report

3

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

 Author| Post time: 2020-1-31 15:09:01
| Show all posts
Still not work
Reply

Use magic Report

3

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

 Author| Post time: 2020-2-1 09:45:01
| Show all posts
Rank Department Total
 
     Other 79
 
    Department of Biochemical Engineering 69
 
    Department of Computer Science 67
 
    Home Office 65
 
    Department of Basic Sciences 64
 
    Department of Economic Management 63
 
    Department of Mechanical Engineering 57
 
    Department of Electrical Engineering 56
 
It ’s still not bound under the rankings.
Reply

Use magic Report

1

Threads

8

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-2-1 18:45:01
| Show all posts
int i = 0;
    protected void GridView1_RowDataBound (object sender, GridViewRowEventArgs e)
    {
        e.Row.Cells [0] .Text = "No." + i + "Name";
        i ++;
    }
Reply

Use magic Report

1

Threads

10

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-2-1 19:54:01
| Show all posts
Is the ranking tied? <% # Eval ("Ranking")%> ??? Did you write it? ?
Reply

Use magic Report

3

Threads

17

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

 Author| Post time: 2020-2-2 13:36:01
| Show all posts
nailed it...
Thank you so much ...
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