Saturday, 15 April 2017

JSON Rest Api in C# ~mkniit

Json Newtonsoft Rest Api in C#

1. Create database in mysql with name “test” and create table with name “user”, like the below.

table user

2. Create a new application project. In Visual Studio, on the menu click File> New  > Project. For more details, see the following menu on the display.

new project visual studio 2010

3. Then will appear the window New Project like the look below

new project solution visual studio 2010

4. Write down the name of the project that will be created on a field Name. Specify the directory storage project by accessing the field Location. Next, give the name of the solution in the Solution Name. Then click OK.


5. Then you will have created the framework of main program listings by Visual Studio. Here's how it looks.

6. Create a new windows form like the below

windows form visual studio

7. Create a new class “modulePost” for request json parse from rest api client and write the following program listing :

class module post rest api

 8. Next step, Back to windows form and view code to write the following program listing:

form login json newtonsoft rest api

 9. After you write down the program listings, press the F5 key to run the program and if you successfull connect your database the result is :


resullt of json newtonsoft rest api

We have explained how to make a simple program with json newtonsoft rest api  using visual studio 2010 and mysql,

No comments:

Post a Comment