p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional C#, 2nd and 3rd Editions (http://p2p.wrox.com/forumdisplay.php?f=44)
-   -   Chapter 14 Page 780-781 (http://p2p.wrox.com/showthread.php?t=2688)

JonR August 11th, 2003 08:27 PM

Chapter 14 Page 780-781
 
I've been working through the samples in the book and have been learning at a great speed. However, I have run into a problem with the code in the book. After keying in the code from Chapter 14, under the section 'Adding Events to the Database', I get a run-time error "Must use updatable query". I've double and triple checked the code and I have it correct. The SQL statement is a valid INSERT query (Double checked by running it directly in the access database and it works). To be double sure I had it correct I loaded the sample code and it too gives the same error at the same spot (the line 'int queryResult = insertCommand.ExecuteNonQuery();')

I am using Visual Studio .Net Professional 2003. Looking into the error I found that the command object's ExecuteNonQuery() method expects a sql statement that returns no records (as the INSERT query does, and indeed the MSDN help file says INSERT queries are accepted).

Has anyone come across this error? Any hints on how to fix?

Thank you in advance for any help!
-Jon

jonr [at] t1gsoftware [dot] com


All times are GMT -4. The time now is 11:33 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.