How to find informix datasource in visual studio to connect to - c#

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.

Related

DataSource ODBC connection error to PostgreSQL in Visual Studio C# 2010

we are having a problem connecting to a PostgreSQL database. On one laptop we are using:
64-bit Windows 8
32-bit Visual Studio C# 2010
PostgreSQL version 9.0
64bit ODBC driver for PostgresSQL Unicode(x64) 9.0.1
On one desktop computer we are using:
64-bit Windows 7
32-bit Visual Studio C# 2010
PostgreSQL version 9.4
64bit ODBC driver for PostgresSQL Unicode(x64) 9.0.1
On the laptop, the typed datasets are working fine, but on the desktop, we get an error "Failed to call ODBC driver connection utility" when creating a typed dataset as well as "The specified DSN contains an architecture mismatch between the Driver and Application" depending on whether we use an existing connection string or try to test out a newly created one.
In both cases we are connecting to a machine data source created in ODBC beforehand. The machine data source itself tests successfully and has no problems connecting to PostgreSQL.
We are a bit at a loss as to what would make the difference otherwise than the version of PostgreSQL and what would be the best way to resolve this?
Thanks so much for the help!

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.

Visual Studio 2013 Server Explorer custom data provider: MongoDB

Is there any way to add MongoDB as a custom data provider in Visual Studio 2013 Ultimate?
Server Explorer / Connect to Database
I have installed the latest MongoDB C# driver.
There are two APIs to be found on the network, both of them implements the ODBC standard:
One NYU Master's Degree (summer) project, which is compatible with the C++ driver;
Another, which is provided by Simba Technologies and available for a trial run.
After downloading and installing the connector, one must perform a setup with the provided administrator tool, as shown in the following picture.
After testing the connection in the ODBC Data Source Administrator, one should head over to the Visual Studio's interface, where the Database Connection setup is. One must choose the .NET Framework Data Provider for ODBC as a data provider, and the Simba connector will be available, as the following picture shows:
That's all!
Another ODBC driver was recently released that can be used here. It has a unique feature in that it exposes the nested MongoDB data model as a set of relational tables. As a result, the interaction with "relationally" minded apps like Visual Studio will be drastically improved:
http://www.progress.com/products/datadirect-connect/odbc-drivers/data-sources/mongodb
You should add the references to the MongoDB driver to your project.
You can do this by right clicking on your project in the solution explorer.
And then click Add Reference. Then you can locate the dlls from the MongoDB Driver.
After that you can use them in code.
Source:
http://msdn.microsoft.com/en-us/library/wkze6zky.aspx
http://www.drdobbs.com/database/mongodb-with-c/240151668?pgno=2

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();

Does Visual Studio Server Explorer support custom database providers?

I had used Server Explorer and related tools for graphical database development with Microsoft SQL Server in some of my learning projects - and it was a great experience. However, in my work I deal with Oracle DB and SQLite and my hobby projects use MySQL (because they are hosted on Linux).
Is there a way to leverage the database-related tools in Visual Studio with other database providers?
Here is instructions on how to connect to your MySQL database from Visual Studio:
To make the connection in server
explorer you need to do the following:
first of all you need to install the MyODBC connector 3.51 (or latest) on
the development machine (NB. you can
find this at
http://www.mysql.com/products/connector/odbc/
)
Create a datasource in Control Panel/Administrative Tools with a
connection to your database. This data
source is going to be used purely for
Server Manager and you dont need to
worry about creating the same data
source on your clients PC when you
have made your VS.NET application
(Unless you want to) - I dont want to
cover this in this answer, too long.
For the purpose of this explanation I
will pretend that you created a MyODBC
data source called 'AADSN' to database
'noddy' on mysqlserver 'SERVER01' and
have a root password of 'fred'. The
server can be either the Computer Name
(found in Control
Panel/System/Computer Name), or
alternatively it can be the IP
Address. NB. Make sure that you test
this connection before continuing with
this explanation.
open your VS.NET project
go to server explorer
right-click on 'Data Connections'
select 'Add Connection'
In DataLink Properties, go to the provider tab and select "Microsoft OLE
DB Provider For ODBC drivers"
Click Next
If you previously created an ODBC data source then you could just select
that. The disadvantage of this is that
when you install your project
application on the client machine, the
same data source needs to be there. I
prefer to use a connection string.
This should look something like:
DSN=AADSN;DESC=MySQL ODBC 3.51 Driver
DSN;DATABASE=noddy;SERVER=SERVER01;UID=root;PASSWORD=fred;PORT=3306;SOCKET=;OPTION=11;STMT=;
If you omit the password from the
connection string then you must make
sure that the datasource you created
(AADSN) contains a password. I am not
going to describe what these mean, you
can look in the documentation for
myodbc for that, just ensure that you
get a "Connection Succeeded" message
when you test the datasource.
I found this during my research on Sqlite. I haven't had the chance to use it though. Let us know if this works for you.
http://sqlite.phxsoftware.com/
System.Data.SQLite System.Data.SQLite is the original
SQLite database engine and a complete
ADO.NET 2.0 provider all rolled into a
single mixed mode assembly.
...
Visual Studio 2005/2008 Design-Time
Support
You can add a SQLite connection to the
Server Explorer, create queries with
the query designer, drag-and-drop
tables onto a Typed DataSet and more!
SQLite's designer works on full
editions of Visual Studio 2005/2008,
including VS2005 Express Editions.
NEW You can create/edit views, tables, indexes, foreign keys,
constraints and triggers interactively
within the Visual Studio Server
Explorer!
The Server Explorer should support any database system that provides an ODBC driver. In the case of Oracle there is a built in driver with Visual Studio.
In the Add Connection Dialog click the change button on the data source you should then get a list of the providers you have drivers for.
Oracle has a set of tools that integrates with Visual Studio. It's packaged with their data access libraries.
http://www.oracle.com/technology/software/tech/windows/odpnet/index.html

Categories