MyCommand.SelectCommand.CommandText = "select count(*) from news where typeid='(int)MyDataGrid.DataKeys[e.Item.ItemIndex]'";改为MyCommand.SelectCommand.CommandText = "select count(*) from news where typeid='"+MyDataGrid.DataKeys[(int)e.Item.ItemIndex]+"'";

解决方案 »

  1.   

    MyCommand.SelectCommand.CommandText = "select count(*) from news where typeid="+(int)MyDataGrid.DataKeys[e.Item.ItemIndex]+"";
      

  2.   

    没有'' ,只样就行了 ="+(int)MyDataGrid.DataKeys[e.Item.ItemIndex]+"";
      

  3.   

    imfine() 和 cmsoft(韦小宝是我的老乡.net)两种有什么区别吗?我用了 cmsoft(韦小宝是我的老乡.net)的写法,调试没有错误!
      

  4.   

    cmsoft(韦小宝是我的老乡.net),谢谢你!已搞定! imfine()和cmsoft(韦小宝是我的老乡.net),一人50分,OK?谢谢各位了!以后还请各位多多帮忙!