Oracle remote connection without installing the oracle client - c#

Is there a way to connect to a remote oracle DB from a client PC without installing oracle on the client ?

You need to download an ADO.NET driver for Oracle. Here's a step by step guide.

You don't need to install all of Oracle but only the ODBC driver.

Everything depends upon the remote server. If the remote server is not permitting remote access to db then u cannot access it anyway.Instead u need to build some sort of webservice and deploy that web service to the same remote server. And call the web service into your app.
The web service will act as a local app to db and will return your desired things, written in code. If its allowing remote access then as adviced above are good options.
I hope, you got it.

Related

can't connect to a database remotely on a c# app which i can see by visiting that server's phpmyadmin site

I have added a database via phpmyadmin on a server. I can access it via http://ipaddress/phpmyadmin . but when i try using those credentials to connect to that db on a c# app , i get the error : unable to retrieve the list of database.
I don't have the right to access the server. I have a user who has rights to two db which i can see when i remotely connect to that server's phpmyadmin. Is it possible that i have right to the db just via phpmyadmin but can't access it via app because i don't have the right to do it because mysql is forbidding it ? I also have a raspberry pi handy. is using it as a db server a better alternative than this ?
Since phpMyAdmin runs on a web server, most people install it on the same machine the database is running on and access it remotely through the network. That means their phpMyAdmin is communicating with MySQL locally, often without the connection leaving the server. Your C# application, on the other hand, is a compiled application that would likely run on your client machine, not the server - meaning any connection from the application to the database is occurring through the network (or internet, depending again on your configuration). Since exposing the MySQL port is generally a bad idea, your MySQL may be configured to only listen locally, or you may have a firewall or NAT connection blocking you from even reaching the server. If that's the case, you may need to rethink how you'll communicate with the database (oftentimes exposing an API is a better solution than opening port 3306 to the world).
It's also possible you're using two different user accounts. To MySQL, an individual user account consists not only of the username, but also the hostname. You can use a wildcard hostname (%) which means all hosts, except it's really "all hosts connecting via TCP/IP networking connection."
It's possible that your application and your phpMyAdmin are using two different connection methods; one using TCP/IP and the other using sockets. Check which phpMyAdmin is using (the easiest way to do so is to look at the host phpMyAdmin is connecting to; 'localhost' is a socket connection and '127.0.0.1' is networking). Configure your C# application the same way.

How should my C# application securely connect to my AWS EC2 database?

As I see it, I have two options: access my database with a ReSTful (http) webservice connection, or directly connecting to MySQL. I've found that it isn't that easy to directly access MySQL (http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html) and that the remote connection is IP-specific (my app would run in many places and the IPs won't be static).
How should applications connect to databases? Directly or through the httpd server?
Thank you very much :)
You can allow a MySQL user account to connect from any host (IP addresses).
for example,
GRANT ALL ON foo.* TO bar#'%' IDENTIFIED BY 'PASSWORD';
Depends on how secure you need it to be. We configure an OpenVPN server on the same VPC as the MySQL server and use that to control access to our systems. There is no direct connect to MySQL.

mysql remote server access from C# application

I have done a small C# Win Forms application, that connects to mySQL database using mySQLconnector. This works perfectly ok with my localhost.
String ConnectionString = "server=xx.xxx.xx.xxx;uid=myuserid;pwd=mypassword;database=dbname";
But I do get following error when I try to connect to remote server:
Unable to connect to any of the specified MySQL hosts.
{"No connection could be made because the target machine actively refused it xx.xxx.xx.xxx:3306"}
I have pinged the server from command prompt and I get response.
I also verified mySQL server settings in remote server database (correct name/ip, portno:3306, skip networking:OFF)
The remote server is accessible without any problem from web server that runs php script and uses same settings as the connection sting I listed above.
The mySQL server is hosted on external shared hosting company 123reg.co.uk with me logging to phpmyadmin using same uid/passwd as like in connection string.
I can't understand what is different between webserver accessing OK, but my C# app having trouble with it??
Can any one please help...
Thanks in Advance
Sam
I've had issues with servers setup so they won't accept remote connections. This is for security reasons mainly. Some places will let you enable it in the CP, but if you have direct access to the server, you should be able to follow these steps.
http://www.rackspace.com/knowledge_center/article/mysql-connect-to-your-database-remotely
Your ip address will be different from the web server.
If your ip address is static you can grant access to your ip address within your mysql database ( https://www.google.com.au/search?q=mysql+grant+access+to+user+from+host ).
I'd recommend using the server to access the database and make your c# application talk to your webserver using ajax/json calls ( https://www.google.com.au/search?q=C%23+Win+Forms+ajax+json ) - that way you're not tied to an ip address for access.
Alternatively you can look at setting up ssh tunnels to your webserver if remote shell access is available so you can get the same access as your webserver. ( https://www.google.com.au/search?q=ssh+tunnels+example+mysql That's what I do myself)

How to connect MySQL running on a web server from c#?

I am working on an C# application which would use the remote MySQL database located in my website hosted on a Linux server with PHP & MySQL support.
I tried to connect directly to the MySQL database, but was not able to connect due to restrictions at my hoster side.
can somebody help me please, can i do that with this restrictions ?
You need access to port 3306 on the remote machine. You can test if you have access to this port using telnet or similar
telnet ip 3306
These are the solutions you have:
A) Create local dev environment: You don't provide much information. If my guess is correct you are developing locally and later you plan to deploy your c# application to web server, that also will contain mysql db.
Install mysql in your local machine
Get a copy of the DB.
Configure your C# program to connect to your local mysql (localhost:3306)
When you deploy code it to your web server, it will connect also to your "localhost 3306" that will be the mysql installed into the web server.
B) Use VPN to access mysql: If A is not applicable another solution consist in installing some kind of VPN between web server containing mySQL and the pc running your application. Once VPN is setup and you can access port 3306 (by telnet as explained before), then your app will work.
C) Open ports to access mysql: The most easy solution is asking for administrator to open ports for you. 99% of the times the answer will be no, so I will not follow this route. (Maybe there is some kind of solution in your web provider that allows to open specific ports for a given IP, but I doubt it)
You can't. The server needs to have allowed remote connections and if this isn't possible, than you're out of your luck.
But, there may be another way... If you can create a web service on the server you're able to connect from, you should be able to communicate with the data in mysql virtually from anywhere.
You can try to create a way of API, if your server blocks incoming connections from web, just overload MySQL Functions you need to use with PHP and "echo" results as a server, parse them as a client with your c# application, it is the only way to organize such a system, or, you can allow incoming connection to MySQL, then watch on this article on CodeProject

Is it really possible to access MS Access DB stored on an http server (windows or linux) from a winform app?

As I can see here http://www.sqlstrings.com/MS-Access-connection-strings.htm
one could
Open connection to Access database located on a remote server:
"Provider=MS Remote; Remote Server=http://Your-Remote-Server-IP; Remote Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\App1\Your_Database_Name.mdb"
Did someone try this : access MS Access DB stored on a windows or http server from a winform app ?
This requires the server to implement RDS for the MS Remote provider, which is now deprecated.
Note that this worked via a service (the OLE DB Remoting Provider) and a custom protocol (RDS), so this will not work on a linux server. It will work on a Windows server which has the MS Remote MDAC provider installed. However, it is obsolete technology, and would be better implemented using a more modern technique.

Categories

Resources