请问如何用listbox的Tag绑定数据?
清高给我看看下面的代码!
MarketInfo.DSright.TRolerightsRow newRow=this.dSright1.TRolerights.NewTRolerightsRow();
newRow.BeginEdit();
newRow.userId=this.userid;
newRow.moduleId=(int)this.lbUright.SelectedValue;
newRow.moduleName=this.lbUright.Text;
newRow.tbName=(string)this.lbUright.Tag;
newRow.EndEdit();
this.dSright1.TRolerights.AddTRolerightsRow(newRow);
        this.dSright1.AcceptChanges();
this.sqlDAUright.Update(this.dSright1);
怎么出错?

解决方案 »

  1.   

    你自己在this.sqlDAUright.Update(this.dSright1);这一句加个 try{}catch{}
      比如:
       try
       {
          this.sqlDAUright.Update(this.dSright1);   }(Exception ex)
       {
          Console.WriteLine( ex.ToString());    <--------设置断点,看看输出的是什么
        }
      

  2.   

    你自己在this.sqlDAUright.Update(this.dSright1);这一句加个 try{}catch{}
      比如:
    上一篇发错了。:(   try
       {
          this.sqlDAUright.Update(this.dSright1);   }
       catch(Exception ex)
       {
          Console.WriteLine( ex.ToString());    <--------设置断点,看看输出的是什么
        }
      

  3.   

    update无法找到tabelMapping[tablename]
      

  4.   

    请问如何用listbox的Tag绑定数据?