//返回受影响的行数。
SqlCommand.ExecuteNonQuery();

解决方案 »

  1.   

    判断返回的纪录个数如:Tales[0].Rows.Count==...
      

  2.   

    int i = SqlCommand.ExecuteNonQuery();if (i==0)
      // no record
      

  3.   

    int i;
    i = SqlCommand.ExecuteNonQuery();
      

  4.   

    《Microsoft .Net 程序设计技术内幕》Jeff Prosise
    (http://www.wintellect.com/about/instructors/prosise/netbook.aspx)清华译版