May 2004
Intermediate to advanced
888 pages
22h 31m
English
To execute SQL statements that do not return any resultset, you would use the ExecuteNonQuery() method to invoke the command. SQL statements that fall into this category are, for instance, INSERT, UPDATE, and DELETE. Additionally, you can execute stored procedures, which also do not return a resultset, by using ExecuteNonQuery. Listing 19.1 illustrates the use of this method to insert a record into a database table.
1: program nonquery; 2: 3: {$APPTYPE CONSOLE} 4: 5: {%DotNetAssemblyCompiler 'c:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll'} 6: 7: uses 8: SysUtils, 9: System.Data, 10: System.Data.SqlClient; 11: 12: const 13: c_string = 'server=XWING;database=ugly_bug;Trusted_Connection=Yes'; ... |
Read now
Unlock full access