May 2004
Intermediate to advanced
888 pages
22h 31m
English
This section illustrates how you can use the events that belong to the SqlConnection class. There are two events that SqlConnection exposes. These are shown in Table 18.4.
| Connection Event | Description |
|---|---|
| InfoMessage | Fires when a warning or informational message is sent by the database server. |
| StateChange | Fires whenever the state changes from open to closed or visa versa. |
Listing 18.2 illustrates how to process the information contained in the SQLConnection class events.
1: program events; 2: 3: {$APPTYPE CONSOLE} 4: 5: {%DotNetAssemblyCompiler 'c:\windows\microsoft.net\framework\v1.1.4322\System.Data.dll'} 6: uses 7: SysUtils, 8: System.Data, 9: System.Data.SQLClient, ... |
Read now
Unlock full access