Home > Net >  In the background in the program to create a string array assignment, and then specify as the data s
In the background in the program to create a string array assignment, and then specify as the data s

Time:02-01

In the method as the background:

 
DataTable dt1=SQLDBHelper. SelectDB (" Select Boy from SteffInfo where ID='" + Session (" ID "). The ToString () + "' ");
String [] boylist;
String [] namelist.
If (dt1. Rows [0] [0]. The ToString ()!="")
{
Boylist=dt1. Rows [0] [0]. The ToString (). The Split (' ');
Namelist=new string [boylist Length];//here any problem?

//cycle and find out the name of the boy and working
for (int i=0; i {
The DataTable dt2=SQLDBHelper. SelectDB (" Select ID, Boyname from CorpInfo where ID='" + boylist [I] the ToString () + "' ");
Namelist. [I]=dt2 Rows [0] [1]. The ToString () + "(" + dt2. Rows [0] [0]. The ToString () +") ";
}

DataList1. The DataSource=namelist;
DataList1. DataBind ();
}





Namelist as a 1 d string array created, let the namelist to accept the assignment in a for loop,
Designated as the front desk again a data-bound controls (now have DataList1) data source, what expression in the foreground application show the data?
  • Related