Databases Reference
In-Depth Information
3.
Click OK . The Solution Explorer now includes DDTek.DB2, the assem-
bly name of the DB2 data provider.
4.
Add the data provider's namespace to the beginning of your applica-
tion, as shown in the following C# code fragment:
// Access DB2
using System.Data;
using DDTek.DB2;
5.
Add the connection information for your server and exception handling
code, and close the connection, as shown in the following C# code frag-
ment:
DB2Connection DBConn = new
DB2Connection("Host=Accounting1;Port=50000;User ID=johng;
Password=test01;Database=Test01");
try
{
DBConn.Open();
Console.WriteLine ("Connection successful!");
}
// Display any exceptions
catch (DB2Exception ex)
Search WWH ::




Custom Search