I am new to DNN module development and the I am having an issue with retrieving data from the SQL database via stored procedure. I have tried using the following code:
---------------------------------------------
[AllowAnonymous]
[HttpGet]
public HttpResponseMessage GetTasks(int moduleId)
{
try
{
var tasks = new TaskController().GetTasks(moduleId).ToJson();
return Request.CreateResponse(HttpStatusCode.OK, tasks);
}
catch (Exception exc)
{
return Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc);
}
}
---------------------------------------------
The code was based off of the tutorial I found located here: https://www.dnnsoftware.com/community-blog/cid/155... However, the website I am working with contains multiple connection strings inside the web.config. What is the correct way to retrieve the information?