Home > front end >  Vs web recently do not use the three layers of how to make listviem controls binding, things to unde
Vs web recently do not use the three layers of how to make listviem controls binding, things to unde

Time:10-20

To solve the...

CodePudding user response:

Originally the query code directly to the background of dal inside, and then assign to check the data to the data source is not good ah, don't spray of new right

CodePudding user response:

Define a datatable, the result of check the assignment for the datatable variables, and then put the listview data source is specified for the datatable variables, then execute the databind ();
For example,
 
The datatable dt=your query () method returns the datatable
ListView1. The DataSource=dt;
ListView1. DataBind ();

At the front desk you should how to write a template binding field.

CodePudding user response:

refer to the second floor aykkk response:
define a datatable, the result of check the assignment for the datatable variables, and then put the listview data source is specified for the datatable variables, then execute the databind ();
For example,
 
The datatable dt=your query () method returns the datatable
ListView1. The DataSource=dt;
ListView1. DataBind ();

The front desk you should how to write a template binding field.

Positive solution,,,
  •  Tags:  
  • ASP