I am new to the Informix DBMS. I have to connect to an Informix database which I am running using one dDocker image (https://hub.docker.com/r/ibmcom/informix-developer-database/) on Windows 10.
Please suggest how to connect to this server using C# and an ODBC driver.
Related
Background: My local MS SQL database is configured as following:
TCP/IP disabled with dynamic port (default setting)
When using .Net to connect to my local database, I don't need to enable TCP connection in SQL Server Configuration Manager or specifying the port number in connection string. I just need to put this in app.config
<add name="MyDatabase" connectionString="Initial Catalog=MyDatabase;Data Source=localhost\SQLEXPRESS;Integrated Security=SSPI;"/>
However, I have to enable TCP in order to connect to it using JDBC. I wonder whether there is any way to get around it?
The Microsoft SQL Server JDBC driver is a Type 4 (pure Java) implementation, and it only supports TCP/IP sockets to communicate with SQL Server, therefor it requires TCP/IP to be enabled on the server instance. There is no workaround that magically allows you to connect otherwise.
As also indicated by the comment of vasily.sib, you can switch to jTDS which supports named pipes. See also Connecting to SQL Server LocalDB using JDBC. Just be aware that jTDS is lagging in supporting newer SQL Server versions and newer JDBC specifications.
I know that there is POCO Generator but that's for SQL Server and I need it for an Informix database.
Can you point me to any alternative?
BTW I am using an Informix data server driver in C# to connect to an Informix server.
You could use LINQ to DB, which support couples of databases such as Informix:
Supported databases:
DB2 (LUW, z/OS)
Firebird
Informix
Microsoft Access
Microsoft Sql Azure
Microsoft Sql Server
Microsoft SqlCe
MySql
Oracle
PostgreSQL
SQLite
SAP HANA
Sybase ASE
I hope to be helpful for you:)
I have a simple code that is using C# and Sqlserver 2008.
For my C# code I get the .EXE file to customer and forced to install the .NET framework on her computer to run just the C# code.
But about the Sqlserver; I have installed the complete Sqlserver on my PC then attached my database on management part of that and am using the Sqlserver
now that I want to get my program to customer I install the .NET framework; but how can I run Sqlserver on her computer and attach the database each time?
Lets me to explain more:
The program will use on a local network and is multi_user.
I installed and am using the Sqlserver on my PC. I created my database and it's tables by help of sqlserver management tool.
for connecting to the datatbase I wrote a code that connect via the users IP address and I tested it on my PC with 2 Virtual machine. It is working truely.
My problem is here:
When I get the program to customer, what I have to do exactly?
What about the database I have to do?
I have to install the whole Sqlserver on customer PC and set that PC as a server or I have a better way to do this?
Thanks.
If you want to use sql server as an embedded database for local storage, use sql server CE.
If you want your users to have access to a shared database you'll have to instal sql server (sql server express may do) on some machine in their network, configure the access rights, and adjust their connection strings accordingly. Or use SQL Azure.
I have to install the whole Sqlserver on customer PC and set that PC
as a server or I have a better way to do this?
yes you have todo all this work
1)install sql server and the management
2)install your database
3)remote your database to be used
I connected my database as a (sql server database file) to mt c# .net application.
the connection string was given as a relative path. the client computer asks for sql express server, what should i do? which application should i install in the client pc?
You need to supply the correct connection string, with the database server name.
If the application is supposed to connect to a local database (on the same machine as the application), you need to install SQL Express and setup the database on the client machine.
I have 1 PC (Windows Server 2003 + SQL Server 2008)
and 2 PCs (MS SP2 + my APP)
how I can let my APP connects to sql server 2008 on other PC My APP will connect to server to store data in SQL Server 2008 and read/delete/edit (basic operations)
what is the best way to do that?
NOTE: my APP is written in C# (.NET Platform)
Look here:
how to connect to another sql server database(server pc) in local area network
How to connect to SQL server through IP
From
Connection strings for SQL Server 2008 you have:
Connect via an IP address
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;InitialCatalog=myDataBase;User ID=myUsername;Password=myPassword;
DBMSSOCN=TCP/IP. This is how to use TCP/IP instead of Named Pipes. At the end of the Data Source is the port to use. 1433 is the default port for SQL Server.