回复 2# 的帖子
<td><font color="#ff0033">(<% =DL_Count_Bind() %>)</font></td>
......
public int[] DL_Count_Bind()
{
string sSearch=Request["stxtSearch"].ToString().Trim();
int[] s_sumCount_Class=new int[num];
for(int i=0;i<num;i++)
{
string sSql="SELECT COUNT(*) AS Counts FROM Books a,BookClass b WHERE b.BookClass_Name='"+sBookClassName[i]+"' AND a.Book_Name LIKE '%"+sSearch+"%' AND a.BookClass_ID=b.BookClass_ID";
SqlConnection
sqlcon=new
SqlConnection(strCnn);
SqlDataAdapter sqlda=new SqlDataAdapter(sSql,sqlcon);
DataSet ds=new DataSet();
sqlda.Fill(ds,"BookClass");
s_sumCount_Class[i]=Convert.ToInt32(ds.Tables["BookClass"].Rows[0]["Counts"].ToString());
sqlcon.Close();
}
return s_sumCount_Class;
}
我用return s_sumCount_Class 返回数组时,执行后,在页面上应该是具体的数值,但页面上显示的不是数值却是System.Int32[]