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

如何获取选定行的其中一列的一个值?
public void ProcessRequest (HttpContext context) {
  //string storySN = context.Request.QueryString["storySN"];
  string storySN = "q";
  int voteSum = 0;
  if (!string.IsNullOrEmpty(storySN))
  {
  BRBT_VoteInform br = new BRBT_VoteInform();
  string filter = string.Format("and 1=1 and storySN='{0}'", storySN);
  DsBT_VoteInform ds = br.GetSome(filter);
  if (ds.BT_VoteInform.Rows.Count <= 0)
  {
  context.Response.Write("<script>alert('没有该选项');</script>");
  }
  else 
  {
  voteSum = Convert.ToInt32(ds.BT_VoteInform.Columns[2]);
  }
  context.Response.Write(voteSum);
  } 
  }
  如何将该行第3列的值赋给voteSum ? 求大神指教。。

------解决方案--------------------
DsBT_VoteInform?
DataTable dt..
dt.Rows[0][""].ToString()//dt.Rows[0][2].ToString()