嗨,我有一个 Web 方法,它可以将数据库的数据传递给 jquery ajax 函数,但我不知道它可以将 arraylist 传递给 jquery 并且 jquery 能够识别它或不能识别它,如果答案是好的 ,我如何使用数组列表在 jquery ajax中。它是我的代码
[WebMethod]
public ArrayList bringdata()
{
SqlConnection con = new SqlConnection("data source=.;database=site;integrated security=true;");
int cnt;
string sSQL = "Select username ,average,weight,point , Rank() over(order by point desc) as 'ranking' from karbar order by point desc";
SqlCommand cmd = new SqlCommand(sSQL, con);
SqlDataAdapter adapt = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapt.Fill(ds);
ArrayList arrlst = new ArrayList();
foreach (DataRow row in ds.Tables[0].Rows)
{
arrlst.Add(row);
}
return arrlst;
}
请在 jquery 代码中帮助我使用arraylist。非常感谢