日期:2014-05-17  浏览次数:20789 次

错误,累死人也找不出来,大家帮忙看看啊
  private void ShowSelf()
        {
            string sql = "select nickname,faceid,sex,age,Loginpwd,friendshippolicyid,[name],starid,bloodtypeid from USers where id = " + UserHelper.id;
            using (DataTable dt = DBHelper.GetData(sql))
            {
                picFace.Image=ilFaces.Images[int.Parse(dt.Rows[0]["faceid"].ToString())];
                picFace.Tag = int.Parse(dt.Rows[0]["faceid"].ToString());
                txtId.Text = UserHelper.id;
                txtAge.Text = dt.Rows[0]["age"].ToString();
                txtNickName.Text = dt.Rows[0]["nickname"].ToString();
                cmSex.Text = dt.Rows[0]["Sex"].ToString();
                if (!(dt.Rows[0]["name"] is DBNull))
                {
                    txtName.Text = dt.Rows[0]["name"].ToString();
                }
                if (!(dt.Rows[0]["starid"] is DBNull))
                {
                    cmStar.SelectedIndex = int.Parse(dt.Rows[0]["starid"].ToString());// 错误::InvalidArgument=“8”的值对于“SelectedIndex”无效。
参数名: SelectedIndex

                }
                else
                {
                    cmStar.SelectedIndex = 0;