GithubHelp home page GithubHelp logo

databooster / dbwebapi Goto Github PK

View Code? Open in Web Editor NEW
98.0 17.0 50.0 15.37 MB

(Migrated from CodePlex) DbWebApi is a .Net library that implement an entirely generic Web API (RESTful) for HTTP clients to call database (Oracle & SQL Server) stored procedures or functions in a managed way out-of-the-box without any configuration or coding.

Home Page: https://dbwebapi.codeplex.com/

License: MIT License

JavaScript 1.98% C# 78.02% HTML 0.63% Batchfile 3.13% PowerShell 8.76% PLSQL 1.24% TypeScript 4.87% CSS 0.03% TSQL 1.27% ASP.NET 0.07%
ado-net asp-net odp-net bulk csv dataaccess database ddtek excel json

dbwebapi's People

Contributors

abelcheng avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dbwebapi's Issues

Retrieving unnamed columns from a ResultSet

Hi,

Great Project by the way.
I am having a bit of an issue, where I am trying to pass null to a mandatory SP parameter.
However, I am receiving Exception:

Value cannot be null. Parameter name: DynamicPropertyNameOfColumn0

Is there a solution to this problem? Please note I cannot change the Stored Proc.

Great work

Thank you for this excellent project.

.Net Client hangs on ayns/await

Hi ,

I found clients hangs on with out ConfigureAwait(false). Once i add this(ConfigureAwait(false), it works fine. thought , it will help full to you to modify the code.

Thanks
Sam

#if WEB_API2
protected async Task ExecAsAsync(string requestUri, IDictionary<string, object> inputParameters, CancellationToken cancellationToken) where T : class
{
HttpResponseMessage httpResponse = await ExecRawAsync(requestUri, inputParameters, cancellationToken).ConfigureAwait(false);
return httpResponse.ReadAs();
}
#else

Table Valued Parameter SP is not supported. The type of column 'Comparer' is not supported.

Hi, I am using TVP for bulk insert in my SP, following to the example in wiki I found always there is error message ""The type of column 'Comparer' is not supported. The type is 'IEqualityComparer`1'"

Here is my SP
Create Procedure [dbo].[Gatewaypayment_PCD_test ]
(@inGroupID int, @inTvpCategories dbo.CategoryTableType READONLY)

as
insert into Gatewaypayment_CTTest(CategoryID,Weight,CategoryName)
select ct.CategoryID, ct.Weight, ct.CategoryName from @inTvpCategories as ct

My Table and Type Table
CREATE TYPE dbo.CategoryTableType AS TABLE
( CategoryID int, Weight float(6), CategoryName nvarchar(50) )

CREATE table Gatewaypayment_CTTest
(CategoryID int, Weight float(6), CategoryName nvarchar(50))

Here is my json request
{
"inGroupID": 108,
"inTvpCategories": [
{
"CategoryID": 1,
"Weight": 0.15,
"CategoryName": "Peach Blossom"
}
]
}

Here are full error message response

{
"Message": "An error has occurred.",
"ExceptionMessage": "The type of column 'Comparer' is not supported. The type is 'IEqualityComparer1'", "ExceptionType": "System.ArgumentException", "StackTrace": " at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource1 completion, Int32 startRpc, Int32 startParam)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n at DbParallel.DataAccess.DbAccess.CreateReader(String commandText, Int32 commandTimeout, CommandType commandType, Action1 parametersBuilder, Int32 resultSetCnt)\r\n at DbParallel.DataAccess.DbAccess.ExecuteStoredProcedure(StoredProcedureRequest request, Action1 readAction, List1& outputParameters)\r\n at DbParallel.DataAccess.DbAccess.ExecuteStoredProcedure[T](StoredProcedureRequest request)\r\n at DataBooster.DbWebApi.WebApiExtensions.ExecuteDbApi(ApiController apiController, String sp, IDictionary2 parameters)\r\n at MocDbApi.Controllers.DbWebApiController.DynExecute(String sp, InputParameters allParameters) in C:\\www\\MyDbWebApi\\MyDbWebApi\\Controllers\\DbWebApiController.cs:line 25\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}

Please Help,

Many Thanks.

Javascript client array not deserializing on Server

I am trying to pass a JS data array through to the server for bulk insertion but I receive an deserialize error. See the details/examples below.

Javascript Array Construction

I am constructing my JS array as follows:

var dataParams = [];
// foreach item...
dataParams.push({
                ID1: 1,
                ID2: 2,
                Value: 'xyz'
            });

$.getDb(url, dataParams, function(response){
   /// do something
});

ERROR

I receive this error in .Net:

Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'System.Collections.Generic.Dictionary`2[System.String,System.Object]' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly.

To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array.

GUID's not supported?

Hi when I send GUID to the stored procedure I get error:
Failed to convert parameter value from a String to a Guid.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.