if you are using a SqlCommandBuilder, then you can use
SqlCommandBuilder.GetInsertCommand().CommandText
to see the SQL Statement

解决方案 »

  1.   

    謝謝您的指點,我handle了它的InsertCommand,顯示為:
    NSERT INTO Users( UserID , Password , SurName , GivenName , DOB , Sex , Nationality , Address , Email ) VALUES ( ? , ? , ? , ? , ? , ? , ? , ? , ? )
    真不知所謂「語法錯誤」何在,在同一個DataSet中,我用同樣的方法Adapter其它的表沒有任何問題,不知這個User表中是怎麼回事。
    我的Access表如下所示,一切正常呀?
    http://wuchungtang.www1.dotnetplayground.com/kkk.jpg
      

  2.   

    sorry, frankly, I have no idea
      

  3.   

    wait, you mean UserID is an identity field?
      

  4.   

    Yes,but I've already used that in other Table and it's OK. I found in SQL there's a keyword "USER_ID" not "UserID". I really want to know what's wrong with the "Syntax". Who can help me,please!
      

  5.   

    Or do u mean that I can't use "UserID" as primary key?
      

  6.   

    解決了。經過本人無數次的弱智型測試,最終證明:"Password"不能作字段名。他嗎的,SQL裡也沒學過這個關鍵字呀。不知哪位知道有這個關鍵字,類似問題碰到不止一次了,誰能總結一張表,告訴我們哪些詞是禁用的,免得浪費時間。我看還有一個避免的辦法,就是不要用英文單詞做字段名。