1

I'm creating a window app using C# (looks like this)

alt text

I'm using MySQL database.
But my database is hosted by some free hosting site.

I posted a question here post1, post2 regarding on how to connect to a remote database and they say that I have to use a webservice to connect my window app to a remote database, since the hosting site doesn't allow remote connection.

My problem is I don't know how to start from the scratch, please recommend a site where i can use as a guide in making webservice and how to use it. I found some, but it's too advance for me and for my simple requirements. (A simple insert sql statement will work right?)

My Server Information: VistaPanel version:2.4.1 RC3 Operating systemLinux Apache version:2.2.15 (Unix) PHP version:5.2.13 MySQL version:5.1.45

Community
  • 1
  • 1
yonan2236
  • 13,371
  • 33
  • 95
  • 141

1 Answers1

1

You can use a PHP REST interface to the database (which is a webservice). Everything is described here: http://phprestsql.sourceforge.net/

Put the PHP Code on the free host and query it from your C# app like they do from JS in the tutorial.

Sven Koschnicke
  • 6,523
  • 2
  • 34
  • 49
  • i have no idea how I will use it in my c# app. :( – yonan2236 Sep 28 '10 at 08:31
  • When using the rest-library you can insert a row into the database by making a http put request from your c# app and providing the data for the name and message values in this request. before, you need to authenticate (HTTP basic authentication) as described in the tutorail. What specific questions do you have about that? – Sven Koschnicke Sep 28 '10 at 09:10
  • how i use it/integrate it into my app since i'm developing a window app? – yonan2236 Sep 28 '10 at 14:24
  • make http-requests from your windows app. there should be a library for c#, see this tutorial for example: http://devlicio.us/blogs/derik_whittaker/archive/2009/02/14/posting-data-to-a-rest-service-using-c.aspx and for authentication http://blogs.msdn.com/b/buckh/archive/2004/07/28/199706.aspx – Sven Koschnicke Sep 29 '10 at 06:18