Connecting to oracle in same way SQL+ uses - c#

I regularly run the same SQL command against multiple different oracle databases we have. I am trying to create a simple C# program that will allow me to run the command and display the data in a DataGrid. I am not the DBA of the database and currently have access to to the DB's using SQL+. Is there a way I can connect to the database, run a statement and disconnect so that it runs a the database end in exactly the same way as if I had used SQL plus?
I have seen different methods of connecting to oracle from C# but my question is mainly aimed to find out which one would work in my current setup, where SQL+ works.

It won't matter in which way you connect to the database. The privileges are connected to your username the Oracle database. SQL+ is just a tool you use to connect to the database.
So if you're able to connect to the database in code with your username you can issue the query the same way you would in SQL+.

Related

Two-Way Synchronization between Azure SQL and wpf/uwp clients

I have a Azure SQL database, and then clients (UWP and WPF) running SQLite that gets data from the database.
The clients can change the data and it updates the Azure SQL rows and they can insert new items/rows.
My problem is that multiple clients are working at the same time and i would like the client to update as soon as there is a change (insert/update/delete) on the Azure SQL database. Today the user has to press update in order to get latest.
However I not sure how to implement this.
I have been looking into using SQL "Change Tracking" https://learn.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-tracking-sql-server?view=sql-server-2017and can easily active Change Tracking in Azure on the SQL server and Table, however i cannot find any documentation on how to use this to sync to client in C#, is there some?
Maybe there is a better way of doing this?
Any input is much appreciated.

Synchronize remote Mysql database to local in C# GUI Application

I'm implementing an application to sync data from a remote mysql server to local mysql database. Without the main part (Synchronization) I have almost done with the application.
I want to know how to synchronize my local mysql database from a remote mysql database. I'm ok if it want to run from PHP scrip. but, if it runs from PHP script I want to know how to call php script from C# application. So the application can call php and sync at a certain time. Apologize if my question is unclear to you.
Any help on this would be great.
Thanks in Advanced!
Why you cant setup master -slave replication with your local database. Here is more information.
Here is good starting point.
Mysql database sync between two databases

Installing C# Windows Form Application with Database on another system

I have developed a winform application in C#.net and using SQL Server 2008.
My application inserts and updates values into database.
Is it possible to install the application on a another system which doesn't have sql server on it?
Imagine using sql azure. Cloud based sql server. The database is never on the same physically computer. It's all down to the connection string.
With an on premise database you need to make sure the database allows external connections, maybe opening up firewall etc. then make sure the connection string is set correctly on the application to talk to external database.
You can even configure to change the connection string as required pointing at different databases depending on the individual requirements.
Scott
Yes, you can. You can access the DB remotely by referring remote DB server in connection string.
It is possible, if you are looking to run the application on machine that is running on the same Domain as the SQL Server and has privileges to the SQL Server.

How to Synchronize SQLServer Database and MySQL Database

My Scenario:
I have two applications. First one is a website which is connected to MySQL Database and 2nd one is a Desktop Application which is connected to SQL Server2008 R2 Database.
The Desktop application updates records locally and the MySQL database is updated online though the website.
Problem:
Two different databases, how can we update at the spot when changes are made either in MySQL or SQL Database?
What I Want:
Databases should be synchronized to each other (e.g. if changes are made in MySQL then SQL server database should be updated, or if changes are made in SQL Database then MySQL database should be updated)
Could anybody please suggest some code, any idea, or any solution to solve this issue?
Make use of Restful API's to Update information from MS SQL server to MYSQL server.
One of the first things I would point out is that complete and perfect syncing is not possible. Unfortunately there will be data types that exist in SQL Server that don't exist in MySQL and vice versa.
But assuming the data types are pretty simple and the schemas are similar, here are some options:
Use a service bus. You can write an application that monitors both database systems and when it sees a change, it pushes an object onto the service bus. Listeners to the service bus will see the objects and write them to the appropriate destination.
Use triggers like Alex suggested. SQL Server can have CLR code execute on a trigger. The CLR code could be some C# that writes directly to MySQL. Takes some setup, but it's possible. I've investigated running a process from a trigger in MySQL and all options are ugly. It's possible, but security is a major concern. The idea is that a record is changed, trigger is fired and an external process is run.
Write an application that constantly looks for "diffs" in tables and moves data back and forth. You'll need to modify all tables to make sure there is support for date/time stamps for each record so you can track when a record has "changed".

connecting remote mysql database using c#.net

I am developing c# windows application.
In that I want to connect to mysql database which resides in another system.
Please help me to solve this?
Assuming that you know how to connect to and query a database, you'll need the following:
The ADO.NET provider for MySQL
The hostname or IP address of the server
A user ID and password to connect with
Add a reference to the MySQL provider. From there, it works just like connecting to a SQL Server box, except the class names are a bit different and some minor SQL dialect is also different.
Of course, if you don't already know how to connect to a database, you'll need to start a bit slower. I'd recommend you Google yourself a basic data-access tutorial.
Good luck!

Categories

Resources