locked
ExecuteNonQuery error RRS feed

  • Question

  • Hi All,

          I am just try to insert the values to the postgresql database, and I was found above error

     'Npgsql.NpgsqlDataAdapter' does not contain a definition for 'ExecuteNonQuery' and Q body

                                                                                                                   Pravin Thokal

    • Moved by Dummy yoyo Friday, April 6, 2012 7:08 AM (From:Visual C# Language)
    Tuesday, March 27, 2012 11:08 AM

Answers

All replies

  • Hi,

    And the line of code and the type of the object on which it happens is ?

    Assuming this is a DataAdapter it seems correct (that is having an error message seems correct as ExecuteNonQuery is not a DataAdapter method). Could it be some confusion between a DataAdapter and a Command object ? (ExecuteNonQuery is a Command method). On a DataAdapter you would rather call the Update method.

    Try http://msdn.microsoft.com/en-us/library/system.data.common.dbdataadapter.aspx which serves as a base for all Adapters and DbCommand that serves as a base for command classes (http://msdn.microsoft.com/en-us/library/system.data.common.dbcommand.executenonquery.aspx).


    Please always mark whatever response solved your issue so that the thread is properly marked as "Answered".


    • Edited by Patrice ScribeMVP Tuesday, March 27, 2012 11:14 AM
    • Proposed as answer by Dummy yoyo Thursday, March 29, 2012 5:58 AM
    • Marked as answer by Mr. Wharty Friday, June 1, 2012 1:45 AM
    Tuesday, March 27, 2012 11:13 AM
  • Hi Pravin,
    Welcome to the MSDN forum!

    For issues about Postgresql database, you'd better try the following site:

    http://www.postgresql.org/ 

    Have a nice day.

    yoyo


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
    • Edited by Dummy yoyo Thursday, March 29, 2012 6:03 AM
    Thursday, March 29, 2012 6:02 AM