我是这么做的:
datarow newrow[]=this.ds.Tables["xxx"].Select("zzz='"+this.str+"'");然后是:("select ID from xxx where ID="+Convert.ToInt32(newrow["ID"]),"SonVocation");老抱错,该怎么改啊,谢谢大家了~

解决方案 »

  1.   

    newrow[0]["ID"] newrow是数组
      
    *****************************************************************************
    欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码) 最新版本:20070127http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
      

  2.   

    还有个错误,使用了未赋值的newrow局部变量,这该怎么办啊~求救!
      

  3.   

    DataRow[] newrow; 
    for(int j=0;j<dslist.Tables["FatherVocation"].Rows.Count;j++)
    {
    if (str2==this.dslist.Tables["FatherVocation"].Rows[j["FatherVocationName"].ToString())
    {newrow = this.dslist.Tables["FatherVocation"].Select("FatherVocationName='"+str2+"'");
    break;}}这么写对吗,请各位帮个忙!
    }
      

  4.   

    Select("zzz='"+this.str+"'");toSelect("zzz="+this.str.tostring);这样试试
      

  5.   

    DataRow[] newrow = null;  // 初始化为null,不然编译器会报错