Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
97c0720
Create DataReader.cs
christianshay Feb 24, 2020
ef9d39f
Update DataReader.cs
christianshay Feb 24, 2020
59ae4bd
Add files via upload
christianshay Feb 24, 2020
6ddc7d3
Create adb-odp-efcore.cs
alexkeh Mar 3, 2020
21f2d7e
Update adb-odp-efcore.cs
alexkeh Mar 3, 2020
b647c5f
Create README.md
alexkeh Mar 3, 2020
a1162c8
Create README.md
alexkeh May 9, 2020
1a714b3
Updated with .NET Core 3.x extension method
alexkeh May 29, 2020
f587ed7
Update README.md
alexkeh May 29, 2020
bd15dfb
Updated doc link
alexkeh May 30, 2020
966b799
Moved TnsAdmin and WalletLocation to Main
alexkeh Jun 1, 2020
4c77f9e
Update README.md
alexkeh Jun 1, 2020
4a83ef5
Create keyless-entity-types-views.cs
alexkeh Jun 5, 2020
04e0b7e
Create README.md
alexkeh Jun 5, 2020
1c5e86f
Genericized connection string
alexkeh Jun 11, 2020
c58538a
Removed hard-coded password
alexkeh Jun 11, 2020
d08f38e
Removed password
alexkeh Jun 17, 2020
8005131
Update AssocArray.cs
alexkeh Jun 17, 2020
0f12d09
Update StatementCache.cs
alexkeh Jun 17, 2020
a2205b1
Update ConnectionParams.cs
alexkeh Jun 17, 2020
299e089
Update DataReader.cs
alexkeh Jun 17, 2020
9af8907
Update ClientFactory.cs
alexkeh Jun 17, 2020
0ecae8a
Update Connection1.cs
alexkeh Jun 17, 2020
eb969ba
Update ConnectionParams.cs
alexkeh Jun 17, 2020
79d9ce4
Update ConnectionParams.cs
alexkeh Jun 17, 2020
502bf4b
Update ConnectionParams.vb
alexkeh Jun 17, 2020
6b176a6
Update psfEnlistTransaction.cs
alexkeh Jun 17, 2020
67bc5e1
Update psfTxnScope.cs
alexkeh Jun 17, 2020
cad3a6d
Update ConnectionStringBuilder.cs
alexkeh Jun 17, 2020
061cc1b
Update Connection2.cs
alexkeh Jun 17, 2020
461eb55
Update Connection3.cs
alexkeh Jun 17, 2020
01ae14c
Update sample1.cs
alexkeh Jun 17, 2020
0cb022c
Update RowUpdate.vb
alexkeh Jun 17, 2020
e0e54e9
Update Sample7.cs
alexkeh Jun 17, 2020
1d61905
Update Sample6.cs
alexkeh Jun 17, 2020
bbde6e5
Update Sample4.cs
alexkeh Jun 17, 2020
6769fb8
Update sample1.cs
alexkeh Jun 17, 2020
42dd150
Update sample2.cs
alexkeh Jun 17, 2020
b1b3df8
Update Sample7.cs
alexkeh Jun 17, 2020
6447afe
Update Sample6.cs
alexkeh Jun 17, 2020
3f30ad9
Update Sample5.cs
alexkeh Jun 17, 2020
d2bdc83
Update Sample4.cs
alexkeh Jun 17, 2020
7fe12e2
Update Sample3.cs
alexkeh Jun 17, 2020
fc89173
Update Sample2.cs
alexkeh Jun 17, 2020
52e134b
Update Sample3.cs
alexkeh Jun 17, 2020
097bd3a
Update Sample5.cs
alexkeh Jun 17, 2020
0bdfad0
Update keyless-entity-types-views.cs
alexkeh Jul 19, 2020
e22400a
MV grant info and scaffolding instructions added
alexkeh Jul 19, 2020
3c43474
Update README.md
alexkeh Jul 24, 2020
89e7521
Update README.md
alexkeh Oct 12, 2020
3a29590
Update README.md
alexkeh Oct 12, 2020
d7ad57c
Update and rename samples/dotnet-core/asp.net-core/Program.cs to samp…
alexkeh Nov 2, 2020
de777c6
Update and rename samples/dotnet-core/asp.net-core/Startup.cs to samp…
alexkeh Nov 2, 2020
9eb1dd7
Update Program.cs
alexkeh Nov 2, 2020
74b05a6
Update Program.cs
alexkeh Nov 2, 2020
62664ea
Update Startup.cs
alexkeh Nov 2, 2020
08df05b
Create Program.cs
alexkeh Nov 2, 2020
af80cb8
Create Startup.cs
alexkeh Nov 2, 2020
2d4a722
Delete Program.cs
alexkeh Nov 2, 2020
a4b23bf
Rename Startup.cs to Program.cs
alexkeh Nov 2, 2020
7fa9d41
Create Startup.cs
alexkeh Nov 2, 2020
b6db563
Rename samples/dotnet-core/autonomous-db/autonomous-odp-core.cs to sa…
alexkeh Nov 3, 2020
b81ed2a
Update README.md
alexkeh Nov 3, 2020
c334a9d
Update README.md
alexkeh Nov 3, 2020
3941739
Update README.md
alexkeh Nov 3, 2020
17dc256
Create Program.cs
alexkeh Nov 3, 2020
3e58427
Create Startup.cs
alexkeh Nov 3, 2020
64df3fc
Create cicqn-json.cs
alexkeh Feb 12, 2021
c7321cc
Create setup.sql
alexkeh Feb 12, 2021
6639652
Update setup.sql
alexkeh Feb 12, 2021
3e8b819
Create README.md
alexkeh Feb 12, 2021
ae4fe3b
Rename session-demos/2021/21c/cicqn-json.cs to session-demos/2021/cic…
alexkeh Feb 12, 2021
15180af
Rename session-demos/2021/21c/setup.sql to session-demos/2021/cicqn-j…
alexkeh Feb 12, 2021
2b199e6
Rename session-demos/2021/21c/README.md to session-demos/2021/cicqn-j…
alexkeh Feb 12, 2021
a8a6f6b
Update README.md
alexkeh Feb 12, 2021
5c16e22
thanks (#145)
christianshay Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ For beginning Oracle .NET developers, these <a href="http://www.oracle.com/techn

<H2>More Information</H2>
<ul>
<li><a href="http://docs.oracle.com/cd/E63277_01/index.htm">Documentation</a></li>
<li><a href="https://docs.oracle.com/en/database/oracle/oracle-data-access-components/19.3/">Documentation</a></li>
<li>Code samples are included with the ODAC Oracle Universal Installation. You will find them in the "ODACSamples" directory in the Oracle Client installation home (e.g. d:\app\client\&lt;username&gt;\product\&lt;Oracle version&gt;\client_1\ODACsamples).</li>
<li>Contibutions to code samples should review <a href="CONTRIBUTING.md">CONTRIBUTING</a> for more details.</li>
<li>You may use files in this repository only if in compliance with the <a href="LICENSE">LICENSE</a>.</li>
Expand Down
3 changes: 2 additions & 1 deletion samples/array-bind/ArrayBind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ class ArrayBind
static void Main(string[] args)
{
// Connect
string connectStr = "User Id=scott;Password=tiger;Data Source=oracle";
// This sample code's DEPT table shares the same characteristics as SCOTT schema's DEPT table
string connectStr = "User Id=<USER ID>;Password=<PASSWORD>;Data Source=<TNS ALIAS>";

// Setup the Tables for sample
Setup(connectStr);
Expand Down
4 changes: 2 additions & 2 deletions samples/assoc-array/AssocArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ static void Main(string[] args)
{
Console.WriteLine("Demo: PL/SQL Associative Array");

// Connect
string connectStr = "User Id=scott;Password=tiger;Data Source=oracle";
// Provide password and connect
string connectStr = "User Id=scott;Password=<PASSWORD>;Data Source=oracle";

// Setup the Tables for sample
Setup(connectStr);
Expand Down
6 changes: 3 additions & 3 deletions samples/autonomous-db/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
These ODP.NET Autonomous DB code samples are intended to be used with the [Developing .NET Applications for Oracle Autonomous Database tutorial](https://www.oracle.com/technetwork/topics/dotnet/tech-info/default-5032178.html).
These ODP.NET Autonomous Database code samples are intended to be used with the [Developing .NET Framework Applications for Oracle Autonomous Database tutorial](https://www.oracle.com/database/technologies/appdev/dotnet/adbdotnetfw.html).

This sample demonstrates how to connect to Oracle Autonomous Database, Including Oracle Autonomous Transaction Processing and Autonomous Data Warehouse.
This sample demonstrates how to connect to Oracle Autonomous Database, including Oracle Autonomous Transaction Processing and Autonomous Data Warehouse.

Create a new .NET Framework project and add either managed or unmanaged ODP.NET assembly. Managed ODP.NET ([Oracle.ManagedDataAccess](https://www.nuget.org/packages/Oracle.ManagedDataAccess)) can be downloaded from NuGet Gallery. Unmanaged ODP.NET can be added after an [ODAC installation](https://www.oracle.com/database/technologies/dotnet-odacdev-downloads.html). Paste the sample code into the project. You can then enter your ADB connection and configuration information into the sample code as described in the comments.
Create a new .NET Framework project and add either managed or unmanaged ODP.NET assembly. Oracle recommends using managed ODP.NET for most .NET Framework apps. Managed ODP.NET ([Oracle.ManagedDataAccess](https://www.nuget.org/packages/Oracle.ManagedDataAccess)) can be downloaded from NuGet Gallery. Unmanaged ODP.NET can be added after an [ODAC installation](https://www.oracle.com/database/technologies/dotnet-odacdeploy-downloads.html). Paste the sample code into the project. You can then enter your ADB connection and configuration information into the sample code as described in the comments.

This directory contains the
managed and unmanaged ODP.NET samples. The ODP.NET Core sample is located [here](https://github.com/oracle/dotnet-db-samples/tree/master/samples/dotnet-core/autonomous-db).
7 changes: 7 additions & 0 deletions samples/autonomous-db/managed-odp/web-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
To use the ASP.NET web sample code:
1. Create an empty ASP.NET Web Application (.NET Framework) in Visual Studio.
2. Add managed ODP.NET (Oracle.ManagedDataAccess) to your project from NuGet Gallery.
3. Save the files in this Github directory to your local project directory.
4. Add the files to your web project as existing items.
5. Modify the User Id, Password, and Data Source as necessary to connect to your Autonomous Database instance.
6. Run the app.
78 changes: 39 additions & 39 deletions samples/client-factory/ClientFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*****************************************************************************/

using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;

class FactorySample
{
static void Main()
{
string constr = "user id=scott;password=tiger;data source=oracle";

DbProviderFactory factory =
DbProviderFactories.GetFactory("Oracle.ManagedDataAccess.Client");

DbConnection conn = factory.CreateConnection();

try
{
conn.ConnectionString = constr;
conn.Open();

DbCommand cmd = factory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "select * from emp";

DbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
Console.WriteLine(reader["EMPNO"] + " : " + reader["ENAME"]);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}

*****************************************************************************/
using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;
class FactorySample
{
static void Main()
{
string constr = "user id=scott;password=<PASSWORD>;data source=oracle";
DbProviderFactory factory =
DbProviderFactories.GetFactory("Oracle.ManagedDataAccess.Client");
DbConnection conn = factory.CreateConnection();
try
{
conn.ConnectionString = constr;
conn.Open();
DbCommand cmd = factory.CreateCommand();
cmd.Connection = conn;
cmd.CommandText = "select * from emp";
DbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
Console.WriteLine(reader["EMPNO"] + " : " + reader["ENAME"]);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ConnectionStringBuilderSample
{
static void Main(string[] args)
{
string connString = "user id=scott;password=tiger;Data source=oracle;";
string connString = "user id=scott;password=<PASSWORD>;Data source=oracle;";
bool bRet = false;

// Create an instance of OracleConnectionStringBuilder
Expand Down
74 changes: 37 additions & 37 deletions samples/connection/Connection1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,40 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*****************************************************************************/

using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;

class GetSchemaSample
{
static void Main(string[] args)
{
string constr = "User Id=scott; Password=tiger; Data Source=oracle;";
string ProviderName = "Oracle.ManagedDataAccess.Client";

DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);

using (DbConnection conn = factory.CreateConnection())
{
try
{
conn.ConnectionString = constr;
conn.Open();

//Get all the schema collections and write to an XML file.
//The XML file name is Oracle.ManagedDataAccess.Client_Schema.xml
DataTable dtSchema = conn.GetSchema();
dtSchema.WriteXml(ProviderName + "_Schema.xml");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}

*****************************************************************************/
using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;
class GetSchemaSample
{
static void Main(string[] args)
{
string constr = "User Id=scott; Password=<PASSWORD>; Data Source=oracle;";
string ProviderName = "Oracle.ManagedDataAccess.Client";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
using (DbConnection conn = factory.CreateConnection())
{
try
{
conn.ConnectionString = constr;
conn.Open();
//Get all the schema collections and write to an XML file.
//The XML file name is Oracle.ManagedDataAccess.Client_Schema.xml
DataTable dtSchema = conn.GetSchema();
dtSchema.WriteXml(ProviderName + "_Schema.xml");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}
142 changes: 71 additions & 71 deletions samples/connection/Connection2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,74 +15,74 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
*****************************************************************************/

using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;

class GetSchemaSample
{
static void Main(string[] args)
{
string constr = "User Id=scott; Password=tiger; Data Source=oracle;";
string ProviderName = "Oracle.ManagedDataAccess.Client";

DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);

using (DbConnection conn = factory.CreateConnection())
{
try
{
conn.ConnectionString = constr;
conn.Open();

//Get MetaDataCollections and write to an XML file.
//This is equivalent to GetSchema()
DataTable dtMetadata =
conn.GetSchema(DbMetaDataCollectionNames.MetaDataCollections);
dtMetadata.WriteXml(ProviderName + "_MetaDataCollections.xml");

//Get Restrictions and write to an XML file.
DataTable dtRestrictions =
conn.GetSchema(DbMetaDataCollectionNames.Restrictions);
dtRestrictions.WriteXml(ProviderName + "_Restrictions.xml");

//Get DataSourceInformation and write to an XML file.
DataTable dtDataSrcInfo =
conn.GetSchema(DbMetaDataCollectionNames.DataSourceInformation);
dtDataSrcInfo.WriteXml(ProviderName + "_DataSourceInformation.xml");

//DataTypes and write to an XML file.
DataTable dtDataTypes =
conn.GetSchema(DbMetaDataCollectionNames.DataTypes);
dtDataTypes.WriteXml(ProviderName + "_DataTypes.xml");

//Get ReservedWords and write to an XML file.
DataTable dtReservedWords =
conn.GetSchema(DbMetaDataCollectionNames.ReservedWords);
dtReservedWords.WriteXml(ProviderName + "_ReservedWords.xml");

//Get all the tables and write to an XML file.
DataTable dtTables = conn.GetSchema("Tables");
dtTables.WriteXml(ProviderName + "_Tables.xml");

//Get all the views and write to an XML file.
DataTable dtViews = conn.GetSchema("Views");
dtViews.WriteXml(ProviderName + "_Views.xml");

//Get all the columns and write to an XML file.
DataTable dtColumns = conn.GetSchema("Columns");
dtColumns.WriteXml(ProviderName + "_Columns.xml");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}


*****************************************************************************/
using System;
using System.Data;
using System.Data.Common;
using Oracle.ManagedDataAccess.Client;
class GetSchemaSample
{
static void Main(string[] args)
{
string constr = "User Id=scott; Password=<PASSWORD>; Data Source=oracle;";
string ProviderName = "Oracle.ManagedDataAccess.Client";
DbProviderFactory factory = DbProviderFactories.GetFactory(ProviderName);
using (DbConnection conn = factory.CreateConnection())
{
try
{
conn.ConnectionString = constr;
conn.Open();
//Get MetaDataCollections and write to an XML file.
//This is equivalent to GetSchema()
DataTable dtMetadata =
conn.GetSchema(DbMetaDataCollectionNames.MetaDataCollections);
dtMetadata.WriteXml(ProviderName + "_MetaDataCollections.xml");
//Get Restrictions and write to an XML file.
DataTable dtRestrictions =
conn.GetSchema(DbMetaDataCollectionNames.Restrictions);
dtRestrictions.WriteXml(ProviderName + "_Restrictions.xml");
//Get DataSourceInformation and write to an XML file.
DataTable dtDataSrcInfo =
conn.GetSchema(DbMetaDataCollectionNames.DataSourceInformation);
dtDataSrcInfo.WriteXml(ProviderName + "_DataSourceInformation.xml");
//DataTypes and write to an XML file.
DataTable dtDataTypes =
conn.GetSchema(DbMetaDataCollectionNames.DataTypes);
dtDataTypes.WriteXml(ProviderName + "_DataTypes.xml");
//Get ReservedWords and write to an XML file.
DataTable dtReservedWords =
conn.GetSchema(DbMetaDataCollectionNames.ReservedWords);
dtReservedWords.WriteXml(ProviderName + "_ReservedWords.xml");
//Get all the tables and write to an XML file.
DataTable dtTables = conn.GetSchema("Tables");
dtTables.WriteXml(ProviderName + "_Tables.xml");
//Get all the views and write to an XML file.
DataTable dtViews = conn.GetSchema("Views");
dtViews.WriteXml(ProviderName + "_Views.xml");
//Get all the columns and write to an XML file.
DataTable dtColumns = conn.GetSchema("Columns");
dtColumns.WriteXml(ProviderName + "_Columns.xml");
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.WriteLine(ex.StackTrace);
}
}
}
}
Loading