A further article on NET connection informix Database

xiaoxiao2021-03-06  40

original:

Http://www-1.ibm.com/support/docview.wss?uid=swg21192027

Microsoft Visual Studio .NET C # Code Example That Opens a connection to a ibm informix Database Using The IBM Informix .NET Provider.

ProblemThis document provides a Microsoft Visual Studio .NET C # code example that opens a connection to a IBM Informix Database using the IBM Informix .Net Provider. SolutionINTRODUCTIONThis document provides a Microsoft Visual Studio .NET C # code example that opens a connection to a IBM Informix Database using the IBM Informix .Net Provider.BEFORE yOU BEGINThis document assumes you have Microsoft Visual Studio .NET or Microsoft Visual Studio .NET 2003 installed. It also assumes you have IBM Informix Client SDK 2.81.TC3 or greater installed. The IBM Informix The .NET Provider Uses The setnet32.exe registry value. This document assumes you have entered you informixserver connection information using set32.exe

. STEPS1 Copy file Class1.cs.txt to working directory and rename to Class1.cs:. 2 Edit Class1.cs and modify the connString value as noted in the code comments.3 Open a Visual Studio .NET Command Prompt Window Click.

Start -> Programs -> Microsoft Visual Studio .NET -> Visual Studio .NET Tools -> Visual Studio .NET Command Prompt

4. SET INFORMIXDIR Equal to The Path of You IBM Informix Client Install Directory.

> set informixdir = c: / sdk281 / bin

5. Add informidir / bin to your path.

> set path =% informixdir% / bin;% PATH%

6. Compile class1.cs.

> csc /r:%informixdir%/bin/ibm.data.informix.dll class1.cs

7. Run Class1.exe.

> Class1.exe

Using:

Server = = = store_demo; uid = carw; password = #####

Success!

Common problemsysymptom:

Compile Error:

Error CS0006: metadata file 'ibm.data.informix.dll' Could Not Be Found

> csc /r: ibm.data.informix.dll class1.cs

Microsoft (R) Visual C # .NET Compiler Version 7.10.3052.4

For Microsoft (R) .NET Framework Version 1.1.4322

Copyright (c) Microsoft Corporation 2001-2002. All Rights Reserved.

Error CS0006: metadata file 'ibm.data.informix.dll' Could Not Be Found

RESOLUTION:

Specify path to ibm.data.informix.dll

> CSC / R:

% InformixDir%

/ bin

/

IBM.DATA.INFORMIX.DLL CLASS1.CS

Symptom:

Unhandled Exception At Runtime

> Class1.exe

Unhandled Exception: System.IO.FileNotFoundException: File or Assembly Name IBM.

Data.informix, or one of its dependencies, Was Not Found.

File name: "IBM.Data.informix"

RESOLUTION:

IBM.Data.informix Driver Does Not Exist in Gac (Global

AskEMBLY CACHE).

See the Document 'Installing .NET Provider' Listed In The Related Url Section of this Page for Information On Resolving this Driver Problem.

转载请注明原文地址:https://www.9cbs.com/read-68766.html

New Post(0)