5/2/2023 0 Comments Typeerror failed to fetchI suppose that the swagger.json file is generated when I run Swagger, since I use this code in method:ĬonfigureServices(IServiceCollection services) services.AddSwaggerGen(c => I want to add that no 500, 503 or any other error or exception is thrown, so it can be sent in the response. (_defaultParameterName, parameterValue.GetType().GetOleDbType()).Value = parameterValue ĭbAdapter.Fill(dataSet) //**Dataset is not filled when executing API on live If (parameterValue = null) throw new System.Exception("No se acepta NULL en el valor del parametro") SqlCommand.CommandType = CommandType.StoredProcedure įoreach (var parameterValue in parameters) ![]() OleDbCommand sqlCommand = dbAdapter.SelectCommand Using (OleDbDataAdapter dbAdapter = new OleDbDataAdapter(storedProcedure, dbConnection)) Using (var dbConnection = new OleDbConnection(_connectionString)) Public DataSet GetWithProcedure(string storedProcedure, params object parameters) Retrieve data from DB using storedProcedure and parameters. The error occurs when the "Fill" method is called. Convert a list of datarows to a list of typed objects Var dataSet = repository.GetWithProcedure(DbProcedure.ReporteVentasPorCliente, Cod_Cliente, Fecha_Inicio, Fecha_Final) ![]() ![]() Var repository = new ProcedureRepository(new Connection_Adapter().ConnString) Procedure repository: Manage methods to retrieve Dataset and Execute queries This ONLY happens when the API is published live, localhost works like a charm. The only way to bypass the error is using SqlConnection, SqlCommand and DataReader to read data from DB, but in my case I need to use OleDbConnection, OleDbCommand and OleDbAdapter to Fill a Dataset, due to some restrictions when using the first approach. My problem is that error "TypeError: Failed to fetch" is shown in Swagger UI and when API of endpoints is used.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |