⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.html

📁 Adding and making operations LOB data in a database with C#
💻 HTML
字号:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="Author" content="Reghu">
   <meta name="GENERATOR" content="Mozilla/4.7 [en] (WinNT; I) [Netscape]">
   <title>ReadMe</title>
</head>
<body>

<h1>
<b><u><font face="Arial,Helvetica"><font color="#000099">Passing LOB Parameters
From And To A Stored Procedure</font></font></u></b></h1>

<p><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Contents of this
document:
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#1.Overview of the Sample">Overview
of the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Required Software">Required
Software</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Assumptions">Assumptions</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Description of  files in the sample">Description
of&nbsp; files in the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#5. Prepare and Run the Sample">
Prepare and Run the sample</a>
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="#Steps followed in the sample">Steps
in the sample</a>
<h2>
&nbsp;<a NAME="1.Overview of the Sample"></a><font face="Arial,Helvetica"><font color="#000099">Overview
of the Sample</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This sample shows how
to pass LOB parameters to&nbsp; and from&nbsp; Oracle stored procedure
using Oracle Provider for OLEDB and ActiveX Data
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Objects (ADO) with
Visual CSharp Beta2 version .&nbsp; It also demonstrates that Oracle provider
for OLEDB bypasses PL/SQL limitation of
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parameter size greater
than 32K&nbsp; to a&nbsp; database&nbsp; stored&nbsp; procedure.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; With OraOLEDB, for
passing the LOB variables as parameter to a SQL statement or stored procedure,
the property 'SPPrmsLOB' is to set to
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; true to tell the provider
that a LOB parameter is being passed .
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The property can be set as&nbsp;
ADO command object property just before executing the procedure. This way
the extra network trip is performed for
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; executionof that command
only. So it is a better practice to set the&nbsp; property to 'True' just
before execution of the procedure&nbsp; and then setting it to
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'False'.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The sample shows how to set
the 'SPPrmsLOB' property with command object.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Note : The maximum size of
image that can be passed as&nbsp; OUT parameter to stored procedure with
OraOLEDB is 64K. Images greater than this
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
size may not be&nbsp; retrieved properly from database.
<br>&nbsp;
<h2>
&nbsp;<a NAME="Required Software"></a><font face="Arial,Helvetica"><font color="#000099"><font size=+2>Required
Software</font></font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Oracle 8x database .
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Visual CSharp.Net Beta 2
version
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Oracle Provider for OLEDB
Release 8.1.7
<br>&nbsp;
<h2>
&nbsp;<a NAME="Assumptions"></a><font face="Arial,Helvetica"><font color="#000099">Assumptions</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. A database user e.g.. Oraole
with password Oraole has already been created.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. The tables with data
used by the sample have already been created using the SQL scripts. Referdb8setup.html
for more information about
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
setting up the database tables and populating data.
<br>&nbsp;
<h2>
<font face="Arial,Helvetica"><font color="#000099">&nbsp;<a NAME="Description of  files in the sample"></a>Description
of&nbsp; files in the sample</font></font></h2>
&nbsp;
<table BORDER COLS=4 WIDTH="100%" >
<tr>
<td WIDTH="4%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">Sr No</font></font></h4>
</td>

<td WIDTH="10%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">File Name</font></font></h4>
</td>

<td WIDTH="10%">
<h4>
<font face="Arial,Helvetica"><font color="#000099">Type</font></font></h4>
</td>

<td>
<h4>
<font face="Arial,Helvetica"><font color="#000099">File Description</font></font></h4>
</td>
</tr>

<tr>
<td>1</td>

<td>&nbsp;ReadMe.html</td>

<td>HTML File</td>

<td>ReadMe File for the application</td>
</tr>

<tr>
<td>2</td>

<td>ADODBHandler.cs</td>

<td>CSharp class file</td>

<td>Declares and defines the class for handling database functions.</td>
</tr>

<tr>
<td>3</td>

<td>StartForm.cs</td>

<td>CSharp class file</td>

<td>This file contains the definition of class for the form used by application..</td>
</tr>

<tr>
<td>4</td>

<td>AssemblyInfo.cs</td>

<td>CSharp class file</td>

<td>Generated by compiler, this file contains assembly information for
project.</td>
</tr>

<tr>
<td>5</td>

<td>ConnectionParams.h</td>

<td>C++ header file</td>

<td>This file contains connection parameters to connect to particular database.&nbsp;</td>
</tr>

<tr>
<td>6</td>

<td>StoredProcedure.sql</td>

<td>SQL script file</td>

<td>This file contains the sql script to create the&nbsp; stored procedures&nbsp;
required by the&nbsp; sample.</td>
</tr>

<tr>
<td>7</td>

<td>StartForm.resx</td>

<td>Resource file</td>

<td>Resource template used by StartForm form</td>
</tr>

<tr>
<td>8</td>

<td>licenses.licx</td>

<td>licx file</td>

<td>Used by resource file</td>
</tr>

<tr>
<td>9</td>

<td>LOBSample.csproj</td>

<td>CSharp&nbsp; Project file</td>

<td>CSharp Project file</td>
</tr>

<tr>
<td>10</td>

<td>LOBSample.sln</td>

<td>CSharp solution&nbsp; file</td>

<td>CSharp Solution&nbsp; file</td>
</tr>

<tr>
<td>11</td>

<td>imageG30.jpg</td>

<td>Image file</td>

<td>Used by ReadMe.html</td>
</tr>

<tr>
<td>12</td>

<td>imageHHP.jpg</td>

<td>Image file</td>

<td>Used by ReadMe.html</td>
</tr>

<tr>
<td>13</td>

<td>imageJ3S.jpg</td>

<td>Image file</td>

<td>Used by ReadMe.html</td>
</tr>
</table>

<h3>
&nbsp;</h3>

<h2>
&nbsp;<a NAME="5. Prepare and Run the Sample"></a><font face="Arial,Helvetica"><font color="#000099">Prepare
and Run the Sample</font></font></h2>
<font face="Arial,Helvetica"><font color="#000099">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</font></font>1.&nbsp; Extract the Sample files. Unzip CSharpLOBSample.zip
using Winzip or command utility
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2<font color="#000000">.&nbsp;
Connect to Oracle Sql*plus using &lt;username>/&lt;password>@&lt;connectstring>
.</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Here &lt;username> refers to the user in which all the tables have been
created and &lt;password> refers to the password given for the above user</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&lt;connectstring> refers to the&nbsp; hostname.</font>
<p><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp;
Make sure you have created the database tables required by this sample.
Refer db8setup.html for more information about setting up the</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
database tables and populating data.</font>
<p><font color="#000000"><font face="Arial,Helvetica">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
4.</font>&nbsp; Create Database Stored Procedure by running StoredProcedure.sql
script.</font>
<br><font color="#000000">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
SQL> @&lt;path>StoredProcedure.sql</font>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5.&nbsp; Open LOBSample.sln
using VCSharp.Net Beta2..
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6.&nbsp; Edit ConnectionParams.csfile
to change the database connection parameters i.e. database name, user name
and password
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
to database you want to use . Save the file.
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7.&nbsp; Build and Run the
sample.
<br>&nbsp;
<h2>
&nbsp;<a NAME="Steps followed in the sample"></a><font face="Arial,Helvetica"><font color="#000099">Steps
in the sample</font></font></h2>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp; Select product from
the list. Its corresponding image should appear in the Existing Image frame.
<center>
<p><img SRC="imageHHP.JPG" height=600 width=576></center>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
fig 1
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.&nbsp; To select
another image for update, click on "Browse " button, a File Open Common
Dialog appears.
<center>
<p><img SRC="imageG3O.JPG" height=601 width=576></center>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.&nbsp; Once the image from the File
Open Common Dialog Box is selected it appears in the new image frame.
<center>
<p><img SRC="imageJ3S.JPG" height=602 width=576></center>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4. "Update Image" button
can be pressed to update the product image in the database
<p>
<hr WIDTH="100%">
<p><b>Please enter your comments about this sample in the OTN Sample code
discussion forum.</b>
<br>&nbsp;
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -