Reputation: 214
I want to connect to MySql database through windows forms application. I will be inserting bulk data into my MySql database once in a day and thereafter will be inserting only what the user selects.
What is better:
1) direct connection to MySql database through c#
2) php files which takes json data and inserts the data
What now follows is only my strong love for a better approach. The geeks out there I want answer for this:
Which is a better practice, considering a) Security reasons b) Maintenance reasons c) Architecture reasons
Thanks in Advance!! Cheers!!!
Upvotes: 2
Views: 1596
Reputation: 3890
I think you should choose the second solution :
You will have to access remotely to your database. This is never a good idea to allow remote access to databases, for security reasons :
Moreover, you would have to ensure that your C# app can communicate with database, means for MySQL that the port 3306 is opened on the machine that executes the app.
The best solution in your case will be to create some PHP webservices just beside your database. Your C# app will call these and send his data, PHP will handle inserts into database.
Advantages :
Disadvantage :
Upvotes: 3