How to create an API for a SQL query
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Mar 22, 2024, 6:29 AM EDT
Hi,
There are several methods to retrieve SQL data in C#. So you can use Entity Framework or ADO.NET to fetch the data from the database. Regardless of the method chosen, it is possible to write the necessary logic within a Web API.
You can go through this article.
https://www.c-sharpcorner.com/article/creating-a-web-api-post-method-to-retrieve-data-from-sql-database-using-asp-net/