Exception: Uknown database type specified

Exception: Uknown database type specified

joenathanjoenathan Posts: 5Questions: 2Answers: 0
edited November 2020 in Free community support

Error messages shown: System.Exception: Uknown database type specified
at DataTables.Database.Adapter()
at DataTables.Database..ctor(String dbType, String str, String adapter)
at Arizona_Cares_Heath_Care_Platform.Views.DcwvehiclesController.Dcwv() in C:\Users\joenathan\source\repos\Arizona Cares Heath Care Platform\Arizona Cares Heath Care Platform\Controllers\DcwvehiclesController.cs:line 47
at lambda_method(Closure , Object , Object[] )
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeNextActionFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)

Description of problem:
.net core 3.1/MVC/mssql

I have an editor table that works perfectly in visual studio under iisexpress, but when I deploy to my IIS Server it doesn't work. The editor table doesn't receive any data, and when I navigate to the api route for the JSON I get the error above.

I feel like I'm missing something very basic... Any help would be much appreciated.

Answers

  • joenathanjoenathan Posts: 5Questions: 2Answers: 0
    edited November 2020

    I solved my problem, incase anyone else runs into this....

    My problem was, I set the variables for the dbtype and the connection string in a json file that seems to get compiled and once deployed to production the variables are no longer available. Fix would be, put your variables elsewhere, or don't use variables and explicitly type your dbtype and connection string.

  • LapointeLapointe Posts: 430Questions: 81Answers: 4

    Hi
    Please mark the question as answered
    thanks

This discussion has been closed.