select a.worth-b.m from player a,soccer b where a.playerid=b.playerid

解决方案 »

  1.   

    同上,应该使用sql来处理这个问题!
      

  2.   

    select isnull(a.worth,0)-isnull(b.m,0) from player a,soccer b where a.playerid=b.playerid
      

  3.   

    就是说现在datagrid已经显示出来了 我要将里面的worth与另一个查询结果比较 这个worth怎么获得 另一个查询结果怎么获得
    在后台比较
      

  4.   

    foreach(DataGridItem Item in DataGrid1.Items)
    {
      if(Item.ItemType==ListItemType.Item || Item.ItemType==ListItemType.AlternatingItem)
    {
              M=Convert.ToDouble(sleItem.Cells[0].Text);
              Sql="select isnull(m,0)-"+M+" from soccer where playerid="+int.parse(DataGrid1.DataKeys[Item.ItemIndex]);
              ...;
             sqlCommand.ExecuteScalar();
    }
    }
      

  5.   

    你也可以在dataset中获取你要的数据,dataset.table(0).rows(i).cells(j)获得某一字段的值