You are here:

C#/Uploading the Data from Window Application to MySQL Server

Advertisement


Question
I have to create 2 applications one is window application in c#.net & MySql server and another is web application in PHP & MySql server. Both the database in in different IP. Now I have to insert in both the databases.

How to do it?

Answer
Hi there,

PHP is not my profession. But in C# it is so simple.

Check this link to learn how to insert, update, delete and more to a mysql database from a c# application.

Here is a part from article:

//Insert statement
public void Insert()
{
   string query = "INSERT INTO tableinfo (name, age) VALUES('John Smith', '33')";

   //open connection
   if (this.OpenConnection() == true)
   {
       //create command and assign the query and connection from the constructor
       MySqlCommand cmd = new MySqlCommand(query, connection);
       
       //Execute command
       cmd.ExecuteNonQuery();

       //close connection
       this.CloseConnection();
   }
}


If you cannot figure it out, try some and post your code, I will fix it for you.

Hope that helps,

Murat

C#

All Answers


Answers by Expert:


Ask Experts

Volunteer


Murat Mehmet

Expertise

I can help with questions about desktop and web programming in C#, including SOAP, XML, database managing, custom controls, security etc.

Experience

I have been developing web and especially desktop applications in C# and VB.Net for almost 5 years. My programming life has begun with VB6 long time ago, so its about 8 years that I am in this business.

Organizations
Was in R & D for 2 years in a popular Turkish technology website: cyber-warrior.com

Education/Credentials
2011 Computer Engineering graduation in University of Trakia in Turkey.

©2016 About.com. All rights reserved.