Deploying .net Informix application - c#

I have a .NET client application which communicates with Informix database.
Now the application is simply not working. To resolve the application I have to install the Informix SDK on each client(which is 250mb file).....then configure ODBC driver manually….
This is completely insane to install 250 MB sdk on each system to install my application which Is in kb’s….is it necessary to install SDK on each system?
I also want to remove the manual step of configuring ODBC driver on each system.
Can someone please point me to the tutorial which describes the deployment of Informix application?

You don't need the whole informix SDK, but you need "Informix Connect" which includes the informix database drivers. Informix connect is 12MB.
I think you can script the ODBC Driver configuration, but you have also to set the informix SETNET configuration for your Informix database. This parameters are stored in the registry.
The keyword for deploying Setnet on the Clients is "Silent Installation", you can install Informix Connect in Silent Mode.
See: Performing a silent installation of Informix and client products
For setnet32 it is possible to save your configuration in a *.nfx file and restore it with "setnet32 -l filename.nfx".

Related

How to force the use of ODBC-version 2.x in C# application

Odbc-driver is version 2.x, but in Visual Studio, Version 3.x is used.
Need to somehow force application to use Version 2.x
Right now, there is an error: "The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr)."
- but finds no way to tell the application to use an other version
Trying to communicate with a Honeywell System.
They are not known for sharing data - but there is a ODBC-driver, written by someone about 15 years ago.
When running on a Windows 2003 server, and compiled (on that same server) in Visual Studio 2005, the application works.
Same application running on other server: Don't work.
Application compiled (x86) on any other machine: Don't work, not on old server, not on new one.
Finds not properties or methods on the System.Data.Odbc.OdbcConnection, to set version of ODBC to use.
At the moment, you get no "error" running the application:
It connects to the dsn, and user is authenticated.
(Changing the username or password gives an error)
- but no data is fetched.
Doing a trace for the calls to the ODBS driver gives:
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed (0)
DIAG [01000] [Microsoft][ODBC Driver Manager] The driver doesn't
support the version of ODBC behavior that the application requested
(see SQLSetEnvAttr). (0)
....
DIAG [IM006] [Microsoft][ODBC Driver Manager] Driver's
SQLSetConnectAttr failed (0)
DIAG [HY096] [Honeywell][ODBC Driver]Info type out of range (1043)
....
DIAG [HYC00] [Honeywell][ODBC Driver]Driver not capable (1010)
So, since there is no newer driver to use - I need my application to use ODBC 2.x - but it still uses ODBC 3.x.
When you tell VS C# to connect to an ODBC Data Source, it invisibly bridges to ODBC using the Microsoft ADO.NET Provider for ODBC, which wants everything to be as up-to-date as it is.
Your best bet in this situation is to switch to a different ADO.NET Provider that understands you can't always have a new ODBC driver, and will do its best to translate the newer C# ADO.NET API calls to the older ODBC API calls when necessary. My employer offers a couple of options, one being the Enterprise Edition Data Access for ODBC Data Sources, and the other being the Virtuoso Universal Server Enterprise Edition (functioning as a Virtual DBMS), both of which are available for immediate download, with a free temporary license provided for your testing and evaluation.

Deploying C# SQL Server SMO application

Forgive me if this is not the correct forum for this ask but I have a c# application that uses SMO to setup a database on a remote server. I am wondering how to deploy this application as it works fine on my dev server but when I deploy it is missing batchparser and batchparser.client.dll files. They exist in the bin folder and I have referenced them by installing the Microsoft.SqlServer.SMO nuget package.
According to the official documentation:
Beginning with SQL Server 2017 SMO is distributed as the Microsoft.SqlServer.SqlManagementObjects NuGet package to allow users to develop applications with SMO.
This is a replacement for SharedManagementObjects.msi, which was previously released as part of the SQL Feature Pack for each release of SQL Server. Applications that use SMO should be updated to use the NuGet package instead and will be responsible for ensuring the binaries are installed with the application being developed.
I would assume this to mean I should be able to install the nuget package and all should be referenced correctly. Am I missing something big here? Does SQL Server need to be installed on the machine I am running my C# application from?
My architecture is as follows:
Web server
SQL Server
Web admin logs into (1) web server and runs my c# program which sets up some IIS based .net websites on that machine, then from the web server it will REMOTELY setup a database by running the smo commands. The C# program will execute the commands on the web server and remotely configure a SQL Server (2)(another machine).
Can this be achieved using C# and SMO without having an instance of SQL/SQL tools on the web server?
Thanks

How to find informix datasource in visual studio to connect to

I want to use EF6 with Informix database .
I have searched a lot and find that i can get
EntityFramework.IBM.DB2 6.0.2 from NuGet for Both Informix and DB2 but my main problem is the connection
How to create a connection to my informix database i can't find any provider for .net to use ?
I want to get a window like this :
:
My current window :
Notes:
I use the informix server version : IBM Informix Dynamic Server Version
12.10.FC3
I use the informix client SDK version : 3.50
I use Visual studio 2012
.net framework 4.5
EDIT :according to the recommendations:
I run C:\Windows\SysWOW64\odbcad32.exe
and configure my ODBC but still unable to access the informix DB through V.S :
EDIT2:
According to the recommendation i have installed IBM Informix Software Bundle and able to connect to visual studio through View -->Server Explorer and find all the tables .but still can't find the informix odbc when i try to change the data source through Entity framework like this :
Assuming the CSDK installation was successful, I suspect the 64-bit version of the ODBC Administrator tool is running, while 32-bit IBM drivers were installed. 32-bit drivers will only be visible running the 32-bit version of the ODBC Administrator tool. Microsoft ships both 32- and 64-bit versions in their OS, but the 64-bit version is the one launched from the menus. (See this related question on Super User: https://superuser.com/q/419832).You can run the 32-bit version from a command prompt:
%windir%\SysWOW64\odbcad32.exe
When you go to add your DSN, you should see the IBM drivers, like in the XP screenshot you posted.
Also, make sure you either enter the full path or cd to the %windir%\SysWOW64 directory. Otherwise, you be launching the 64-bit version, which incidentally is also called odbcad32.exe.
EDIT
Visual Studio 2012 is only available as a 32-bit application. 32-bit applications won't see any data sources created with the default 64-bit ODBC Administrator tool.
Two important caveats …
Make sure you are running the 32-bit ODBC Admin tool. If you simply type odbcad32.exe from a command prompt, you will be running the 64-bit version of the tool. Be sure to launch it using the full path: %windir%\SysWOW64\odbcad32.exe.
If your data source is a system DSN, try creating it as a user DSN. There appears to be a problem for users seeing the system DSNs in the server explorer in VS 2012 and VS 2010.
EDIT 2
I've looked back through this and think there is still some missing requirement in your environment. The are quite a few client packages from IBM and you may very well need one of the packages that is more comprehensive than the "IBM Database Add-Ins for Visual Studio".
I would download and install the "IBM Data Server Client" found at http://www-01.ibm.com/support/docview.wss?uid=swg21385217. Per IBM's description …
This is the all in one client package and includes all the client
tools and libraries available. It includes add-ins for Visual Studio.
I was able to download the IBM Data Server Client. Specifically, this is the one I chose.
IBM Data Server Client (Windows AMD 64)
ibm_data_server_client_winx64_V10.5.zip (576 MB)
Since this package was released on 2012-04-30, I would recommend applying the latest fix packs: http://www-01.ibm.com/support/docview.wss?rs=4020&uid=swg27016878
I don't think you want the IBM Informix .NET provider. See "Table 1" in this IBM tech article. The article also walks through connecting to Informix and using the Visual Studio Add-In.
EDIT 5: In order to get the exact same screens you're looking for and to be fully integrated with Visual Studio, with all the bells and whistles you're now demanding, you will need to install IBM Data Server .NET Provider for Informix, which does not have a Developer Edition. You can only get a Trial Version, which requires additional registration information besides that of a regular Developer Registration.
See detailed full information in the link below, including the exact same integration screens between Visual Studio and IBM Informix you're looking for: Get started with the IBM Data Server .NET Provider for Informix
EDIT 4: Code snippet testing the ODBC connection:
private void Form1_Load(object sender, EventArgs e)
{
try
{
string connString = "Dsn=IFMX32;uid=informix";
string cmd = "select * from syschfree";
OdbcConnection conn = new OdbcConnection(connString);
OdbcDataAdapter adapter = new OdbcDataAdapter(cmd, conn);
conn.Open();
DataTable table = new DataTable();
adapter.Fill(table);
dataGridView1.DataSource = table;
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
EDIT 3: I was able to establish an ODBC connection as explained before using the "bundle" package Informix Developer Edition for Windows 32 Version 12.10TC5DE which includes not only the client SDK but also a test server. As you can see in the picture below, i connected to the sysmaster database. Whether or not you need a test server, perhaps you should install this 32-bit bundle package because it may be installing some additional components that would enable you to get connected.
Here some more details on how the connection was configured in the ODBC Data Source Administration tool:
EDIT 2: The 32-bit Client SDK produces the very same results as shown before.
EDIT 1: You may want to give this a try:
Assuming your client SDK is properly installed, then you should be able to see your driver as shown below. In my case, version 4.10 Developer Edition (64-bit).
Then create a User Data Source as below, using your driver and DB information:
And finally, in Visual Studio, your newly created Data Source should be available:
I don't have a server i could use to test this any further, but again, you could give it a try.
Currently the Visual Studio integration and Entity Framework support is only by using IBM DS driver (IBM Data Server Client) which uses DRDA protocol.
The drivers included with Informix Client SDK uses native protocol called SQLI.
You may try after installing IBM DS Driver.
Unfortunately the IBM DS Driver has limited functionality with Informix server.

Is ODAC must for C# Oracle Database connectivity using ODP.net

I am new to Databases and .net!
I have SQL developer 3.0 installed through which I can connect to the Oracle 11g Database server.
The requirement is to write a C# program to connect to the oracle database and run query; in my visual studio 2013 project I have added a reference to Oracle.DataAccess.Client and written the code, however while debugging an error occurs that says "Ora-12541:TNS:No-Listener".
My question for now is, Do I need to install an Oracle client (64-bit ODAC 11.2 Release 6 (11.2.0.4.0) Xcopy for Windows x64 ?), my assumption was SQL developer will take care of this!
Please help!
SQL Developer has it's own Oracle drivers (JDBC as far as I know), thus you must install Oracle Client in order to connect to an Oracle DB in Visual Studio.
Note, "ODAC" contains only the ODP.NET Data Provider (i.e. mainly the Oracle.DataAccess.dll file). In order to use it, you must install the actual Oracle Client - at least the Instant Client (which is also included in the ODAC Download file).
Consider to use the ODP.NET Managed Driver, then you need only one single DLL, nothing else. It can be downloaded from Oracle page 64-bit Oracle Data Access Components (ODAC) Downloads and works for both 32bit and 64bit applications.
Unless you copied Oracle.DataAccess.dll from another machine, all oracle packages that include it, also include some version of the client. ODAC includes the full version while the xcopy installs have the instant client. I'll also point to the managed provider though for simplicity as it does not have any unmanaged dependencies,
However, if you got all the way to an "ora-xxxxx" error, it sounds like your Oracle client is correctly installed. The only issue you have now is your connection string. If you normally use a TNS name in Sql Developer, than you either need to copy your existing tnsnames.ora to network/admin in your new oracle home dir, or you need to set a TNS_ADMIN system environment variable to point to your existing one. There are other options too, but your error in this case is tns specific.

Best way to connect to Interbase 7.1 using .NET C#

Could someone please explain the best way to connect to an Interbase 7.1 database using .NET/C#?
The application will be installed on many end user computers so the less "add-ons" that I will have to package with my application the better.
CodeGear offers a free ADO.NET 2.0 driver for registered users of InterBase here:
http://cc.embarcadero.com/item/25497
Note that "registered users of InterBase" includes the free InterBase 2007 Developers Edition. The download says that it's for 2007, but it works fine with InterBase 7, and the InterBase team at CodeGear has told me that they have no problem with people using it for that purpose.
I do not recommend using a driver designed for Firebird, as InterBase and Firebird have somewhat different SQL syntaxes, and differ in other features, as well. In particular, I think that using any driver dependent on fbclient.dll with InterBase is outright dangerous.
Check this providers:
Interbase and Firebird Developer's for Visual Studio .Net
Firebird .NET Data Provider
FireBird - InterBase .NET (Mono) Providers
I think the Firebird .net provider is the same as the one that's in mono. Both are excelent btw.
The code in the help file works in many situations but not all, especially on Windows 8.1, Windows Server 2012 machines.
Make sure you get the latest InterBase_ADO.NET from embarcadero. The version I updated to was version 16.0.4327.44959 of Borland.Data.AdoDbxClient.dll. (Right click on file, properties, details to see version number). The install also creates a x64 version folder for 64bit even though I did not use it. I targeted x86 with no issues.
This ADO.NET install is not necessary to do on every machine – you just need to include the below files in your project and have Interbase installed on the machine you are running on. I only installed the driver on my development computer.
The install will extract all the necessary files you need to put in you application to connect to the database. It will also create the readme ADO_NET 2_0 Driver for InterBase XE Installation and Usage Instructions.htm file. IMPORTANT NOTE: the DB connection examples in this help htm file do not work 100% of the time. See my code example below for the solution.
No ODBC connection necessary. The list of the files to be included in your .NET project and to be copied local are:
Borland.Data.AdoDbxClient.dll
Borland.Data.DbxCommonDriver.dll
Borland.Data.DBXInterBaseDriver.dll
Borland.Delphi.dll
Borland.VclDbRtl.dll
Borland.VclRtl.dll
dbxadapter.dll (x86 or x64 version)
dbxint.dll (x86 or x64 version)
gds32.dll (from the interbase DB install)
interbase.msg (from the interbase DB install)
I found two connection strings that worked. To connect use one of two connection string:
connectionstring1 = "DriverName=Interbase;Database=" + database + ";User_Name=" + userid + ";Password=" + password;
connectionstring1 = connectionstring1 + ";SQLDialect=3;MetaDataAssemblyLoader=Borland.Data.TDBXInterbaseMetaDataCommandFactory,Borland.Data.DbxReadOnlyMetaData,Version=11.0.5000.0,Culture=neutral,";
connectionstring1 = connectionstring1 + "PublicKeyToken=91d62ebb5b0d1b1b;GetDriverFunc=getSQLDriverINTERBASE;LibraryName=dbxint30.dll;VendorLib=GDS32.DLL";
connectionstring2 = “User_Name="+userid+";Password="+password+";Database="+database+";ServerType=0;Charset=NONE;LibraryName=.\\dbxint.dll;VendorLib=GDS32.DLL;GetDriverFunc=getSQLDriverINTERBASE;SQLDialect=3";
GlobalObjects.dbconn = (TAdoDbxConnection)TAdoDbxInterBaseProviderFactory.Instance.CreateConnection();
GlobalObjects.database = databasepath;
GlobalObjects.dbconn.ConnectionString = connectionstring1; //or connectionstring2
GlobalObjects.dbconn.Open();

Categories