May 2004
Intermediate to advanced
888 pages
22h 31m
English
Listing 19.5 shows how to invoke a call that requires multiple parameters. This type of code, however, can be unmanageable because database specifics such as the parameters’ names and data types are hard-coded into your source code.
You can use the CommandBuilder class, which essentially queries the database for metadata about the parameters and populates the SqlCommand object with that information. Therefore, you only have to specify the values. Listing 19.7 shows the alternative code from Listing 19.5.
1: program storedproc_cb; 2: 3: {$APPTYPE CONSOLE} 4: 5: {%DotNetAssemblyCompiler 'c:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll'} 6: 7: uses 8: SysUtils, ... |
Read now
Unlock full access