- 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>
<linkrel="stylesheet" href="otn.css" type="text/css"/>
</head>
<bodybgcolor="#ffffff">
<tablewidth="100%" align="Center">
<tbody>
<tr>
<tdwidth="100%">
<h1class="heading1"><aname="SAMPLE_NAME"/></a>RowUpdatingEventHandler
and RowUpdatedEventHandler sample using ODP.NET</h1>
<h2class="heading2">Table of Contents</h2>
<ulclass="list">
<li><ahref="#objective">Objective of the Sample Application</a></li>
<li><ahref="#overview">Overview of the Sample Application</a></li>
<li><ahref="#usernotes">User Notes with Screen Shots </a></li>
<li><ahref="#software">Required Software</a></li>
<li><ahref="#extract">Extracting the Sample</a></li>
<li><ahref="#database">Database Setup</a></li>
<li><ahref="#prepare">Preparing and Running the sample</a></li>
<li><ahref="#stepsins">Steps in the sample</a></li>
<li><ahref="#descsamples">Description of Sample Files</a></li>
</ul>
<tableborder="0" width="96%" height="22">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="objective"/></a> Objective of the Sample
Application</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">
Back To Top</a></td>
</tr>
</tbody>
</table>
<pclass="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>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="overview"/></a>Overview of the Sample
Application</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">
Back To Top</a></td>
</tr>
</tbody>
</table>
<pclass="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>
<liclass="paragraph">The <code>Oracle.ManagedDataAccess.Client</code> namespace
contains ODP.NET classes. </li>
<li><spanclass="paragraph">The </span><code>Oracle.ManagedDataAccess.Types </code><spanclass="paragraph">namespace
contains the ODP.NET Types. </span><br>
</li>
</ul>
<p><spanclass="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><spanclass="code">
</span>events. <code>OracleDataAdapter.RowUpdating </code>event is fired
before a row is updated. <code>OracleDataAdapter.RowUpdated</code><spanclass="code">
</span>event is fired after a row </span><spanclass="tabletext"> is updated.
This allows applications to process this event and initiate appropriate
action. </span>
<pclass="tabletext">
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="usernotes"/></a> User Notes with Screen
Shots</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">
Back To Top</a></td>
</tr>
</tbody>
</table>
<pclass="tabletext"><spantextclass="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><spanclass="OTN_TEXT">
<imgsrc="images/image1.jpg" width="567" height="551" ></span></p>
<p><codeclass="nocolor">Figure 1.1: Screen shot of the Main Screen</code></p>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="software"/></a> Required Software</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<ul>
<li>
<p><spantext="text" class="tabletext">VB.NET installed with Visual Studio
2005/2008/2010/2012.</span></p>
</li>
<li>
<p><spantext="text" class="tabletext"><fontface="Arial,Helvetica">Oracle11g
Database or higher running SQL*Net TCP/IP listener (can be downloaded
<ahref="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html">here</a> )</font>
</span></p>
</li>
<li>
<p><spantext="text" class="tabletext"><fontface="Arial,Helvetica">Oracle
Data Provider for .NET (ODP.NET) (can be downloaded
<ahref="http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html">here</a>
)</font></span></p>
</li>
</ul>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="extract"/></a> Extracting the Sample
</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<Pclass="paragraph"><spantextclass="OTN_TEXT">Unzip <code>RowUpdateEventHandler.zip</code>
using Winzip or command utility to your convenient directory </span><spanclass="OTN_TEXT">referred
to as </span><spanclass="PropertyName"><codeclass="nocolor"><Extract_Dir></code></span><spantextclass="OTN_TEXT">.
Extraction of the zip file results in the creation of <codeclass="nocolor">'</code><code>RowUpdateEventHandler</code><codeclass="nocolor">'</code>
directory. </span><spanclass="OTN_TEXT">Refer <ahref="#descsamples">Description
of Sample Files</a> section for more details. </span>
</P>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="database"/></a> Database Setup</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<p><fontface="Arial, Helvetica, sans-serif">No special database setup is
required. When this application starts it creates the required table </font>'<spanclass="paragraph"><code>COUNTRYTAB</code></span>'
<spanclass="paragraph">and inserts necessary data. You must ensure that
the database user has necessary privileges to drop,create and update tables.</span><br>
</p>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="prepare"/></a> Preparing and Running
the Sample</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<Pclass="paragraph"><spantextclass="OTN_TEXT">1. Open </span><spantext><code>RowUpdateEventHandler.sln</code></span><spantextclass="OTN_TEXT">
using Visual Studio .NET from </span><spanclass="PropertyName"><codeclass="nocolor"><Extract_Dir></code></span><spantextclass="OTN_TEXT"><codeclass="nocolor">\</code></span><spantext><code>RowUpdateEventHandler\src</code></span><spantextclass="OTN_TEXT">
folder. </span></P>
<p></p>
<p><spantext="text" class="tabletext">2. Ensure that the following .NET
Component References have been added to </span><spantext><code>RowUpdateEventHandler</code></span>
<spantext="text" class="tabletext">project: <br>
Oracle.ManagedDataAccess. <br>
</span><spantext="text" class="tabletext">System,<br>
System.Data,
<br>
System.Drawing,
<br>
System.Windows.Forms,
<br>
System.XML, <br>
</span>
<blockquoteclass="tabletext">To add the reference to above .NET Components
<br>
a)Go to Menu ->View-> Solution Explorer. <br>
b)Right click on <spantextclass="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>
<pclass="paragraph"><spantextclass="OTN_TEXT">4. Build and run the sample.
</span></p>
<p></p>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="stepsins"/></a> Steps in the sample</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<pclass="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>
<pclass="paragraph">2. You may update Language or Currency columns. Other
columns are not updatable.</p>
<pclass="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>
<tableborder="0" width="100%">
<tbody>
<tr>
<tdwidth="80%">
<h2class="heading2"><aname="descsamples"/></a> Description of Sample
Files</h2>
</td>
<tdwidth="20%" align="right"><ahref="#SAMPLE_NAME" class="paragraph">Back
To Top</a></td>
</tr>
</tbody>
</table>
<P><spanclass="paragraph">Following is the directory structure of the </span><spantextclass="OTN_TEXT"><code>RowUpdateEventHandler.zip</code>
</span><spanclass="paragraph"><codeclass="nocolor"> : </code></span></P>
<tableBORDERCOLS=3WIDTH="98%" class="tabletext" >
<tr>
<tdwidth="15%"><b>Directory</b></td>
<tdwidth="20%"><b>File Name</b></td>
<tdwidth="65%"><b>Description</b></td>
</tr>
<tr>
<tdROWSPAN="2" class="OTN_TEXT" width="21%"><codeclass="nocolor">RowUpdateEventHandler\doc</code></td>
<tdclass="tabletext" width="19%">Readme.html</td>
<tdclass="tabletext" width="60%">This file</td>
</tr>
<tr>
<tdclass="tabletext" width="19%">otn.css</td>
<tdclass="tabletext" width="60%">Stylesheet used in Readme.html</td>
</tr>
<tr>
<tdclass="OTN_TEXT" width="21%"><codeclass="nocolor">RowUpdateEventHandler\doc\images</code></td>
<tdwidth="19%" class="tabletext">*.jpg</td>
<tdwidth="60%" class="tabletext">This folder contains images used in
the Readme.html file</td>
</tr>
<tr>
<tdclass="OTN_TEXT" rowspan="2" width="21%"><codeclass="nocolor">RowUpdateEventHandler\src</code><codeclass="nocolor"></code></td>
<tdclass="tabletext" width="19%">RowUpdateEventHandler.sln</td>
<tdclass="tabletext" width="60%">Visual Studio Solution</td>
</tr>
<tr>
<tdclass="tabletext" width="19%">RowUpdateEventHandler.suo</td>
<tdclass="tabletext" width="60%">Solution User option (this file gets
automatically generated when a Visual Studio Solution is created)</td>
</tr>
<tr>
<tdclass="OTN_TEXT" rowspan="5" width="21%"><codeclass="nocolor">RowUpdateEventHandler\src\</code><codeclass="nocolor"></code></td>
<tdclass="tabletext" width="19%">AssemblyInfo.vb</td>
<tdclass="tabletext" width="60%">This file stores information about
generated assembly</td>
</tr>
<tr>
<tdclass="tabletext" width="19%">DBAccess.vb</td>
<tdclass="tabletext" width="60%">This file has the code that accesses
database and has the RowUpdating and RowUpdated event handlers</td>
</tr>
<tr>
<tdclass="tabletext" width="19%">RowUpdate.vb</td>
<tdclass="tabletext" width="60%">Main window of this application </td>
</tr>
<tr>
<tdclass="tabletext" width="19%">RowUpdateEventHandler.vbproj.*</td>
<tdclass="tabletext" width="60%">Visual Studio Project Files (these
files are automatically generated when a Visual Studio Project is
created)</td>
</tr>
<tr>
<tdclass="tabletext" width="19%">
<p>*.resx <br>
*.config</p>
</td>
<tdclass="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>