删除listview一条记录时,同时删除数据库中的记录,sql语句怎么写~

解决方案 »

  1.   

    string sql=strint.Format("delete from 表名 where ID={0}",(int)lvwCsdn.SelectedItems[0].Tag)
      

  2.   

    不好意思上面那个string.Format那个string写错了!
      

  3.   

    不晓得是不是这个意思:A是表名  B是字段  lvmB 是 listviewItem lvmB =new listviewItem();             string sql=
                          string.Format(delete from A where B={0},(int)lvwB.selectedItems[0].Tag);   //删除语句
      

  4.   

    delete from A where B={0}要用引号引起来
      

  5.   

    对不起理解错你的意思了我以为你是说{0}这里要引起来!sorry!