Hello, I want to take some information from the OTC website API and put it into a sqlite db. This is what I have to pull the information. It currently saves it into a csv file. What is the easiest way to write it to the DB instead?
- public void otcRestClient()
- {
- var restSharpClient = new RestClient("https://www.otcmarkets.com");
-
- var downloadRequest = new RestRequest("research/stock-screener/api/downloadCSV?pageSize=20",
- Method.GET);
-
- var fileInBytes = restSharpClient.DownloadData(downloadRequest);
-
- File.WriteAllBytes(@"C:\Users\openuser\Documents\Stock Reports\OTC\OTCStockData.csv",
- fileInBytes);
-
- Console.WriteLine("\n\nPress any key ...");
- Console.ReadKey();
- }