I am new to api, i want to ask how to use console app to store api data into sql server database? I have use console app to call api data successfully already, but how can i use console application to insert api data into sql server database table. my web api came from iis server.
Here is the code for call api data:
using (var client = new WebClient())
{
client.Headers.Add("Content-Type:application/xml");
client.Headers.Add("Accept:application/xml");
var result = client.DownloadString("http://localhost/test/api/person");
Console.WriteLine(Environment.NewLine + result);
}
MessageBox.Show("Completed");
}