-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathReadme.html
313 lines (311 loc) · 15.2 KB
/
Readme.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<html>
<head>
<title>RowUpdatingEventHandler and RowUpdatedEventHandler sample using ODP.NET- Readme</title>
<link rel="stylesheet" href="otn.css" type="text/css"/>
</head>
<body bgcolor="#ffffff">
<table width="100%" align="Center">
<tbody>
<tr>
<td width="100%">
<h1 class="heading1"><a name="SAMPLE_NAME"/></a>RowUpdatingEventHandler
and RowUpdatedEventHandler sample using ODP.NET</h1>
<h2 class="heading2">Table of Contents</h2>
<ul class="list">
<li><a href="#objective">Objective of the Sample Application</a></li>
<li><a href="#overview">Overview of the Sample Application</a> </li>
<li> <a href="#usernotes">User Notes with Screen Shots </a></li>
<li><a href="#software">Required Software</a></li>
<li><a href="#extract">Extracting the Sample</a></li>
<li><a href="#database">Database Setup</a></li>
<li><a href="#prepare">Preparing and Running the sample</a></li>
<li><a href="#stepsins">Steps in the sample</a></li>
<li> <a href="#descsamples">Description of Sample Files</a></li>
</ul>
<table border="0" width="96%" height="22">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"><a name="objective"/></a> Objective of the Sample
Application</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">
Back To Top</a> </td>
</tr>
</tbody>
</table>
<p class="tabletext">The purpose of this sample application is to demonstrate
how one can trap the <code>OracleRowUpdatingEvent</code> and <code>OracleRowUpdatedEvent</code>
using VB.NET. </p>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="overview"/></a>Overview of the Sample
Application</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">
Back To Top</a> </td>
</tr>
</tbody>
</table>
<p class="tabletext">Oracle Data Provider for .NET (ODP.NET) is an implementation
of a data provider for the Oracle database. ODP.NET uses Oracle native
APIs to offer fast and reliable access to Oracle data and features from
any .NET application. ODP.NET is provided in <code>Oracle.ManagedDataAccesss.dll
</code>assembly and provides two namespaces :<br>
</p>
<ul>
<li class="paragraph">The <code>Oracle.ManagedDataAccess.Client</code> namespace
contains ODP.NET classes. </li>
<li><span class="paragraph">The </span><code>Oracle.ManagedDataAccess.Types </code><span class="paragraph">namespace
contains the ODP.NET Types. </span><br>
</li>
</ul>
<p><span class="tabletext">Event handling is the mechanism by which .NET
components register themselves with event generators and then get notified
with the help of a callback when the event is fired. ODP.NET too allows
users to register event handlers and get notified when the event of particular
interest occurs. In this application we demonstrate how one can trap the
<code>OracleDataAdapter.RowUpdating</code> and <code>OracleDataAdapter.RowUpdated</code><span class="code">
</span>events. <code>OracleDataAdapter.RowUpdating </code>event is fired
before a row is updated. <code>OracleDataAdapter.RowUpdated</code><span class="code">
</span>event is fired after a row </span><span class="tabletext"> is updated.
This allows applications to process this event and initiate appropriate
action. </span>
<p class="tabletext">
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="usernotes"/></a> User Notes with Screen
Shots</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">
Back To Top</a> </td>
</tr>
</tbody>
</table>
<p class="tabletext"><span text class="OTN_TEXT">When this sample application
is run, </span>users should supply a username, password and connect string
to connect to a database. The application creates the required table to
set up this application. By default, both RowUpdating and RowUpdated event
handlers are enabled. Users can use the radio buttons to enable, disable
the event handlers. They must click the "Apply" button to carry
out actual eventHandler registration or de-registration. If the event
handler is enabled and country table is updated then corresponding event
handler code is executed. Code inside the eventHandler function (Subroutine)
prints a line in the status window indicating that the function had been
invoked. </p>
<p><span class="OTN_TEXT">
<img src="images/image1.jpg" width="567" height="551" ></span></p>
<p><code class="nocolor">Figure 1.1: Screen shot of the Main Screen</code></p>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="software"/></a> Required Software</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<ul>
<li>
<p><span text="text" class="tabletext">VB.NET installed with Visual Studio
2005/2008/2010/2012.</span></p>
</li>
<li>
<p><span text="text" class="tabletext"><font face="Arial,Helvetica">Oracle11g
Database or higher running SQL*Net TCP/IP listener (can be downloaded
<a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html">here</a> )</font>
</span></p>
</li>
<li>
<p><span text="text" class="tabletext"><font face="Arial,Helvetica">Oracle
Data Provider for .NET (ODP.NET) (can be downloaded
<a href="http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html">here</a>
)</font></span> </p>
</li>
</ul>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="extract"/></a> Extracting the Sample
</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<P class="paragraph"><span text class="OTN_TEXT">Unzip <code>RowUpdateEventHandler.zip</code>
using Winzip or command utility to your convenient directory </span><span class="OTN_TEXT">referred
to as </span><span class="PropertyName"><code class="nocolor"><Extract_Dir></code></span><span text class="OTN_TEXT">.
Extraction of the zip file results in the creation of <code class="nocolor">'</code><code>RowUpdateEventHandler</code><code class="nocolor">'</code>
directory. </span><span class="OTN_TEXT">Refer <a href="#descsamples">Description
of Sample Files</a> section for more details. </span>
</P>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="database"/></a> Database Setup</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<p><font face="Arial, Helvetica, sans-serif">No special database setup is
required. When this application starts it creates the required table </font>'<span class="paragraph"><code>COUNTRYTAB</code></span>'
<span class="paragraph">and inserts necessary data. You must ensure that
the database user has necessary privileges to drop,create and update tables.</span><br>
</p>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="prepare"/></a> Preparing and Running
the Sample</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<P class="paragraph"><span text class="OTN_TEXT">1. Open </span><span text><code>RowUpdateEventHandler.sln</code></span><span text class="OTN_TEXT">
using Visual Studio .NET from </span><span class="PropertyName"><code class="nocolor"><Extract_Dir></code></span><span text class="OTN_TEXT"><code class="nocolor">\</code></span><span text><code>RowUpdateEventHandler\src</code></span><span text class="OTN_TEXT">
folder. </span></P>
<p></p>
<p><span text="text" class="tabletext">2. Ensure that the following .NET
Component References have been added to </span><span text><code>RowUpdateEventHandler</code></span>
<span text="text" class="tabletext">project: <br>
Oracle.ManagedDataAccess. <br>
</span><span text="text" class="tabletext">System,<br>
System.Data,
<br>
System.Drawing,
<br>
System.Windows.Forms,
<br>
System.XML, <br>
</span>
<blockquote class="tabletext">To add the reference to above .NET Components
<br>
a)Go to Menu ->View-> Solution Explorer. <br>
b)Right click on <span text class="OTN_TEXT"><code>RowUpdateEventHandler</code></span>
project, choose 'Add Reference'. <br>
c)Choose the above .NET Components from the list displayed. <br>
d)Click 'Select', then OK. <br>
e) The chosen .NET component gets added to the project. </blockquote>
<p class="paragraph"><span text class="OTN_TEXT">4. Build and run the sample.
</span></p>
<p> </p>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="stepsins"/></a> Steps in the sample</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<p class="paragraph">1. When the Main form of the application appears as
shown in figure 1.1 enter the username , password and connect string as
per your database setting and press "Connect" button.</p>
<p class="paragraph">2. You may update Language or Currency columns. Other
columns are not updatable.</p>
<p class="paragraph">2. To update the rows in the <code>DataGrid</code>
press "Update" button. You may enable or disable the eventhandlers
by using radio buttons but you must press "Apply" button to
carry out actual handler registration or de-registration process.<br>
<br>
<b>Note: </b>The database user used to execute this application must have
necessary privileges to create, delete and modify tables.</p>
<table border="0" width="100%">
<tbody>
<tr>
<td width="80%">
<h2 class="heading2"> <a name="descsamples"/></a> Description of Sample
Files</h2>
</td>
<td width="20%" align="right"> <a href="#SAMPLE_NAME" class="paragraph">Back
To Top</a> </td>
</tr>
</tbody>
</table>
<P><span class="paragraph">Following is the directory structure of the </span><span text class="OTN_TEXT"><code>RowUpdateEventHandler.zip</code>
</span><span class="paragraph"><code class="nocolor"> : </code></span></P>
<table BORDER COLS=3 WIDTH="98%" class="tabletext" >
<tr>
<td width="15%"><b>Directory</b></td>
<td width="20%"><b>File Name</b></td>
<td width="65%"><b>Description</b></td>
</tr>
<tr>
<td ROWSPAN="2" class="OTN_TEXT" width="21%"><code class="nocolor">RowUpdateEventHandler\doc</code></td>
<td class="tabletext" width="19%">Readme.html</td>
<td class="tabletext" width="60%">This file</td>
</tr>
<tr>
<td class="tabletext" width="19%">otn.css</td>
<td class="tabletext" width="60%">Stylesheet used in Readme.html</td>
</tr>
<tr>
<td class="OTN_TEXT" width="21%"><code class="nocolor">RowUpdateEventHandler\doc\images</code></td>
<td width="19%" class="tabletext">*.jpg</td>
<td width="60%" class="tabletext">This folder contains images used in
the Readme.html file</td>
</tr>
<tr>
<td class="OTN_TEXT" rowspan="2" width="21%"><code class="nocolor">RowUpdateEventHandler\src</code><code class="nocolor"></code></td>
<td class="tabletext" width="19%">RowUpdateEventHandler.sln</td>
<td class="tabletext" width="60%">Visual Studio Solution</td>
</tr>
<tr>
<td class="tabletext" width="19%">RowUpdateEventHandler.suo</td>
<td class="tabletext" width="60%">Solution User option (this file gets
automatically generated when a Visual Studio Solution is created)</td>
</tr>
<tr>
<td class="OTN_TEXT" rowspan="5" width="21%"><code class="nocolor">RowUpdateEventHandler\src\</code><code class="nocolor"></code></td>
<td class="tabletext" width="19%">AssemblyInfo.vb</td>
<td class="tabletext" width="60%">This file stores information about
generated assembly</td>
</tr>
<tr>
<td class="tabletext" width="19%">DBAccess.vb</td>
<td class="tabletext" width="60%">This file has the code that accesses
database and has the RowUpdating and RowUpdated event handlers</td>
</tr>
<tr>
<td class="tabletext" width="19%">RowUpdate.vb</td>
<td class="tabletext" width="60%">Main window of this application </td>
</tr>
<tr>
<td class="tabletext" width="19%">RowUpdateEventHandler.vbproj.*</td>
<td class="tabletext" width="60%">Visual Studio Project Files (these
files are automatically generated when a Visual Studio Project is
created)</td>
</tr>
<tr>
<td class="tabletext" width="19%">
<p>*.resx <br>
*.config</p>
</td>
<td class="tabletext" width="60%">.NET XML Resource Template and configuration
files (these files are automatically generated when a Visual Studio
Project is created)</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>