Before you try to access a .NET data source, ensure that the Netezza .NET Provider
installation was successful.
Procedure
-
Create an application that is based on .NET Framework. A C# example
follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Common;
using System.Data;
namespace Sample_Connection
{
class Program
{
static void Main(string[] args)
{
DbProviderFactory factory = DbProviderFactories.GetFactory("NZdotNET");
DbConnection con = factory.CreateConnection();
con.ConnectionString = "Server = vm-dw101.svl.ibm.com;Port = 5480;
Database = system;User id = admin;PWD = password;level=3;logname=c:\\";
con.Open();
Console.WriteLine("Connected successfully.......");
DbCommand cmd = con.CreateCommand();
con.Close();
}
}
}
-
Compile the application.
-
Run the application.
If the application runs successfully, the Netezza Performance Server .NET Provider
was successfully installed.