将代码该为。
protected void Page_Load(object sender, EventArgs e)
{
sqlcon = new SqlConnection(strCon);
string sqlstr = "select * from tb_Member";
SqlDataAdapter myda = new SqlDataAdapter(sqlstr, sqlcon);
DataSet myds = new DataSet();
sqlcon.Open();
myda.Fill(myds, "tb_Member");
DataList1.DataSource = myds;
DataList1.DataBind();
for (int i = 0; i <= DataList1.Items.Count - 1; i++)
{
DataRowView mydrv = myds.Tables["tb_Member"].DefaultView[i]; //此代码应放到for循环中
Label lab = (Label)DataList1.Items[i].FindControl("Label1");
int money = Convert.ToInt32(mydrv["money"]);
lab.Text = money.ToString("¥#,###.00");
}
sqlcon.Close();
}