Click here to Skip to main content
15,891,761 members
Everything / OData

OData

OData

Great Reads

by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package
by Pawel idzikowski
How to replace the web API request query string to provide case insensitive OData search
by NobsterTheLobster
Consume data from a WCF Data service in a .NET client. MSAL OAuth 2.0
by Herman.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN

Latest Articles

by Herman.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
by Sunny Makode
This is an introductory article about creating an Odata Rest API in collaboration with Entity Framework. We are also going to use Autofac as our IOC container. Also, Repository and Unit of Work pattern will be used for cleaner access of persistence model through our ORM (Entity Framework).
by Jeremy Likness
Build data-driven .NET applications with seamless client-server communication using fluent C# LINQ over OData (like GraphQL but without the JSON).
by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package

All Articles

Sort by Updated

OData 

14 Feb 2016 by Abhinav S
There is no need for System.web in ASP.Net 5.You need to use .Net core instead.Alternately, switch back to version 4.5.2.References - ScottGu's Blog - Introducing ASP.NET 5[^].Top 10 Changes in ASP.NET 5 and MVC 6 | Stephen Walther[^]
21 Oct 2012 by Afzal Shaikh
Query seems correct , Please convert parameter @startdate to appropriate date format like that Convert(DateTime,@startdate,Number).or Try with this Select a.Col1, a.col2, b.col1, b.col2from a inner join bon a.id = b.idwhere a.id = @id and Convert(DateTime,b.startdate,103)=...
1 Mar 2016 by Akhil Mittal
This article will explain how to make WebAPI secure using Basic Authentication and Token based authorization.
1 Apr 2016 by Akhil Mittal
This is the last article of the RESTful series in which I’ll explain how you can leverage OData capabilities in ASP.NET WebAPI. I’ll explain what OData is and we’ll create OData enabled RESTful services.
10 Jan 2014 by Amit Kumar Tiwari
I have a business layer written using WCF Data Services (ODATA). I wish to consume them in my web application using JQuery AJAX calls. But my security manager raises concern that jQuery calls can be easily manipulated (and he is right). I want to avoid server side calls as they are costly in...
17 Jul 2015 by Anil Vaghasiya
var _url = "http://localhost:49497/DataService.svc/Mst_User?$filter=Us_Name eq 'Basit' and Us_Password eq 's'&$format=json"; $.ajax({ type: "POST", data: "{ strFUserName: '" + VariableUsername + "', strFPassword: '" + Variablepassword + "'}", ...
14 Jan 2015 by anurag9179
Hello,I am working project server 2013. I am facing some issues regarding In-built report in Project server/ SharePoint 2013. When I open In-Built report, specially Project Overview dashboard reports which uses oData Connection and i think the oData connection may be the cause of this issue,...
8 Jul 2016 by ARIA 5
I have posted a question about Entity framework 6+ and WCF Data ServiceConsuming WCF Data Service EF , Failed to SaveChange()please someone tell me what I am wrong about them.Any help would be truly appreciated,Thanks in advance.What I have tried:I have tried to create a...
30 Nov 2019 by Ashutosh Gpt
create another class contains list of Categories public class CategoriesList { IList ListItem; } public IHttpActionResult Post(CategoriesList categories) { //... } body may something like this: ListItem : [ { id: 1, Category: 'Value1' }, { id: 2, Category: 'Value2' } ]
28 Feb 2014 by Asif Rehman
$(document).ready(function () { var qry = "Db.svc/CustTypes?select=CustTypeTitle&$format=json"; $('#Makes').autocomplete({ source: qry }); }); 1. I'm unable to extract...
30 Nov 2019 by Asif Rehman
This is working fine. public IHttpActionResult Post(Categories categories) { //... } But When I change Categories to Categories[] to received multiple records from javascript client, it show null object. public IHttpActionResult Post(Categories[] categories) { //... } from postman...
16 Jul 2015 by basitsar
Dear,I created OData Services with Custom Authentication, How to pass the UserName & Password in Ajax. Note that without having security below code working fine.Please help on thisBelow is my Code var _url = "http://localhost:49497/DataService.svc/Mst_User?$filter=Us_Name eq...
6 Sep 2015 by basitsar
Dear,I have created data services, below is my login code working fine.var _url = "http://localhost/CMWeb/DataService.svc/Users?$filter=UserName eq '" + "Basit" + "' and Password eq '" + "s" + "'&$format=json"; UserAdmin = 0, $.ajax({ type:...
22 Aug 2019 by BillWoodruff
Use Swashbuckle.OData to generate Swagger: [^] also see: [^] Why not try Swagger support: [^] Are you sure Swagger supports OData: see [^] and [^]
26 Mar 2020 by clemenslinders
LS, In D365BC I created a simple table, card page and list page. You can create a list of workers entering: first name, last name and function. I turned the card page into a web service and now there is a ODATA V3, ODATA V4 and SOAP web service...
26 Mar 2020 by clemenslinders
HI Richard, Thanks for your input. But I received the solution from Gert. For deletion I do not have to pass the E-tag, but I can pass the primary key. Although using the Soap web service I do pass the E-tag. It works when I changed my code...
25 Feb 2013 by CodeBlack
Hi,I am currently working on (basically researching) on OData. So I am new to open data protocol. And i want to use this facility with my web api project. As per the requirement i want to fetch the relational data. Basically a data from Parent and Child tables. Everything seems to be...
4 Dec 2015 by databoom
This tip resolves the problem of Kendo Grid losing the focus after editing in autoSynch mode.
29 Dec 2015 by databoom
This tip is about how to tune up the Kendo Grid when using its authentication feature.
18 Feb 2016 by Dave Kreskowiak
You're asking WAY too much of EF. If this was a requirement (change the DB schema on-the-fly) EF should never have been used.
17 Aug 2018 by Dave Kreskowiak
You never gave any details about your database schema as coded in EF, so this is just a guess. What you're seeing is the expected behavior. You are NOT supposed to make any changes to a column tagged [Timestamp] in EF. Timestamp fields are entirely managed by EF. They are used to manage...
29 Sep 2015 by Deepak_ker
Hi,Currently I am facing some issues while querying the oData services. I am very new to oData query syntax.I am trying to query oData service using the following urlhttps://mysite/DataQueryGroups?$select=Id,Name&$filter=IsHidden eq false&IsShared ne...
31 Aug 2012 by deepakdynamite
Hello,Is it possible to convert Odata into DataTable and Vice-Versa ?Thanks
3 Sep 2012 by deepakdynamite
i need to change our c# code that reads the datatable in the web service and have it read the odata and convert directly or use as a datatable. i need a datatable provider that uses odata
18 Feb 2019 by Derek Viljoen
Run Postman against your service API and see what it gives you. Try to duplicate exactly what your proxy is generating (look specifically at the HTTP headers). You can verify this in Fiddler. Are you sending content-type, and if so what is it set to? Are you sending an 'accept' header in the...
16 Jul 2013 by DyldoB
Our company recently acquired Office 365 Sharepoint Online and the employees have been tasked with managing their projects through the system.Capturing tasks and time is terrible through the current interface which has led me to investigating creating a web interface which interacts with the...
18 Jun 2015 by F-ES Sitecore
Yeah, you definitely want to stay clear of Windows Authentication, it's so insecure...with knowledge like that I can tell you're a *nix man :) You should use usernames and passwords instead, that's way more...
7 Sep 2017 by Herman<T>.Instance
Hi everyone, In my organisation we have a WPF application that connects to an ODATA layer. That layer connects to the database. The database is in a cluster. I was wondering who has experience with such a setup as described. What reactions can I expect in the ODATA layer and in the WPF...
17 Aug 2018 by Herman<T>.Instance
Hi Folks, in my ODATA service I use EF6 to work with SQL Server. An EDMX is created also for the table Departments. In that table there is a TimeStamp field for Concurrency purposes. And yes I have added [Timestamp] data annotation in the code. And in the EDMX the field is FIXED for Concurrency...
11 Feb 2020 by Herman<T>.Instance
Hi All, I have created a WEBAPI (ASP.NET and using Microsoft.AspNet.OData packages to have a V4 version of OData. In my own defined OData Controllers (based on stored procedures exposed via Entity Framework) I have Get Methods to retrieve data....
13 Mar 2020 by Herman<T>.Instance
Hi friends, Struggling with OData V4 when calling a Function. My Client sends to the service: http://wrk2198:80/services/ProjectUsedModels(modelNumber='10000') The webapi service expects:...
24 Jul 2020 by Herman<T>.Instance
Hi Folks, I have a Stored Procedure that retrieves with dynamic column names the results from parameters with dynamic parameter names. In SSMS I see the correct result. I have to expose this DataSet via Entity Framework in my OData Controller. ...
2 Nov 2021 by Herman<T>.Instance
Migrations does not apply to T-SQL rules for ALTER TABLE ALTER COLUMN
12 May 2015 by hypermellow
Hi,I've not used the DataTables API (like you posted above), but if you are looking to search a specific column then I would do it like://Global variable for DataTable ... var dt;//Create your DataTable ... function createDataTable(){ dt =...
15 Jul 2013 by indra.217
how to create ODATA Services for Windows Phone 7 in C# in order to use in Windows Phone Emulator?
11 May 2015 by jayarajlcc
Dear TechiesI am new to WPF , Asp.net Web API , REST and OData. I need to work in a project where WPF is the client (MVVM) that utilizes RESTful services hosted on a Web server (Using Asp.net Web API) communicating using OData. Would any one be kind enough to provide me a very small sample...
21 Nov 2019 by Jeremy Likness
Build data-driven .NET applications with seamless client-server communication using fluent C# LINQ over OData (like GraphQL but without the JSON).
10 Feb 2017 by Jerod Johnson
Use the CData Software API Server to create an OData service for your databases and build a dynamic Web app based on the database data.
3 Nov 2014 by Jeroen E
I figured it out after I came across this link http://stackoverflow.com/questions/2247051/how-to-use-selectmany-with-dataservicequery[^]I turned the query around by first querying and filtering the recruiters and then the addresses.The query ended up like this:var addressesQuerry =...
4 Nov 2014 by Jeroen E
Hello,I have a database containing 2 tables:- recruiters- AddressesThese tables have a n:m relationship.I connect with the database through an OData api.I'm trying to get the addresses of a specific recruiter but can't get it to work.What I've tried is:var...
10 Feb 2015 by Jeroen E
From an MVVM application I get the following URL for delete: http://localhost/Recruiters/Addresses(guid '7777-777')/CIP.Domain.AddressesI did not fill complete guid in the example URL, but it is a valid one.This URL is not a normal OData route, so I created an routing...
16 Feb 2015 by Jeroen E
There were two problems with this as it turns out:First:My web.config was not properly set up to handle a dot in the URL.So I changed it to this: verb="*" type="System.Web.Handlers.TransferRequestHandler" ...
24 Aug 2015 by JimShelley
A simple example of a SharePoint Add-In using the REST API and the Cross Domain library
22 May 2014 by Jitendra Sabat
My Angular code goes belowvar data=['asdfgh','fghjkl','qwerty'];return $http.post(url, JSON.stringify(data)).then(function (result) { return result.data; });My web api controller is public class V1MessageController :...
7 Jun 2012 by Jovan Popovic(MSFT)
How to create OData services using the WCF Data Services and use them
2 Mar 2014 by Jovan Popovic(MSFT)
There is a new connector for jQuery DataTables for OData service. It handles OData services v2, v3, v4. See DataTables OData connector[^]You just need to include the connector js file and setup few parameters in dataTables initialization.
5 Nov 2018 by Jovan Popovic(MSFT)
Create powerful REST API with just few lines of C# code using MsSql.RestApi package
10 Jun 2022 by kmoorevs
I have the following request that gives me the data that I need. The problem I am having is that I need the Quantity summed and grouped by the remaining columns/objects. I have removed the html encoding to improve readability. ...
3 Sep 2012 by Kuthuparakkal
May this help you:Advanced using OData in .NET: WCF Data Services[^]
8 May 2014 by LiQuick
Dear reader,I'm currently trying to access the results of a SAP Gateway ODATA service but one particular method doesn't seem to comply with .net result expectations. The code below is what I'm using and the result is that all the entries are filled with the values of the last entry. LINQPad...
11 May 2014 by LiQuick
Found out what the problem is:There was a KEY defined in the SAP Gateway datamodel, but the returned data didn't contain a key. Somehow the default key was an empty string for each entry, so with the adding of each entry all the data containing the specific key '' would be updated, hence the...
18 Feb 2019 by LiQuick
Dear readers, For a project I need to expose a third party API partly to the public. To do this I thought I could easily get in incoming request, reroute it to the API, get response back and deliver response to the client. Pretty simple concept in theory, but somehow problematic. Partly the...
1 Oct 2019 by Maciej Los
If i understand you well, you're talking about data pagination... Check this out: Paging with ASP.NET Web API OData – Youssef M's Blog[^]
21 Dec 2022 by Madhushanka Chithrananda
I have to read invoice line items. To Read all invoices • projection/v1/InvoiceHandling.svc This would list all the invoices in all company registered in cloud(Only Header Info) To Read exact invoice •...
18 Feb 2016 by Md Shohel Rana
I have a question about EF(Entity Framework)If I have a database that allows the users to add columns and/or tables with columns ( no deletions ) as well as schemas at run time can the EF handle these modifications to the underlying data store without much tweaking or is this asking too...
23 Apr 2014 by mekalareddy
I have a query like thisselect * from xxx where dates between '2012-10-26' and '2012-10-27'.and did as URL likeurl/?$filter=dates gt datetime'2012-10-26' and dates lt datetime'2012-10-27'and I am getting response by using this one.Now, I need to get by time, so I changed the URL...
24 Apr 2014 by mekalareddy
this is the solutiondateTimeOffsetValue = year "-" month "-" day "T" hour ":" minute [ ":" second [ "." fractionalSeconds ] ] ( "Z" / sign hour ":" minute )Example: 2000-01-01T16:00:00.000Z
28 Apr 2014 by mekalareddy
I have tables DEPatientVisit and DEPhysiciani need to filter the data based on StimulatorGourpId of DEPatientVisit. what i tried for this...
12 May 2015 by Member 10503105
I am using DataTables[^] to draw my data. Also I am using OData filter to show only those rows which I need, by several conditions.var dtApi = new $.fn.dataTable.Api("#CardsGrid_grid");...filter assing (for example: "Status eq 0" and...)...dtApi.draw();It works fine. I am receiving...
13 Jan 2014 by Member 10522467
Hello,I have a problem with my wcf data service.When I'm doing a select or an insert, everything is fine.But when I'm try an update or a delete i am refered to my local IP (something like 192.170.1.1).Here is my web.config:
7 Jan 2021 by Member 10870320
Please find the below query that we are sending from the from fe (react ) when we are trying to search with two text boxes .It doesnt return any result. However an oData query with two dropdowns / onetextbox and one dropdown works/single...
6 Jan 2021 by Member 10870320
The full URL is https://localhost:3333/OverviewItem?$count=true&$filter=(contains(name1,'seek') and contains(name2,'aron') &$orderby=name1 desc,name2 desc &$skip=0&$top=10 Even i removed after the $ part still same issue then we find that...
20 Jul 2021 by Member 11030334
I wrote an HTTPClient (.NET Core 3.x) that returns a JSON string but when I try to Deserialize it I run into issues. Issues ranging from can not deserialize array to string or the results are null. The string itself I can view on a Quick Watch...
20 Jul 2021 by Member 11030334
SOLVED I did not want to work with an OData Json object, so I had to strip the OData header and the rest just looked like a collection of JSON docs content = httpResponse.Content.ReadAsStringAsync().Result; var outer =...
4 May 2015 by Member 11662814
How Do i read the Odata standard $ count value in the java when Consuming through the Rest Template.1.I am hitting the service through Rest template Url Example:
10 Aug 2015 by Member 11898286
please tell me any solution.i follow some link but not get right way.http://stackoverflow.com/questions/23288237/visual-studio-2013-server-explorer-custom-data-provider-mongodb" target="_blank" title="New Window">^]
14 Feb 2016 by Member 11915386
I'm trying to port a Web API I wrote in ASP.Net 4.5.2 to ASP.Net 5 for the cross platform support, which turns out to be a critical issue. In my former web api I implemented an OData solution, but when trying to port my web api to ASP.Net 5 I was unable to use System.Web let alone...
31 Aug 2015 by Member 11949649
I dnt understand the problem is wether it from my code or in iis server,this is email-rupi2009@gmail.complease give me the solution.
12 Aug 2022 by Member 15090354
Hi Team, I am using Odata in our application due to that i am not able to call web api methods in Postman or web browser Could you please suggest how to create web api methods same as normal web api methods [EnableQuery] public...
7 Nov 2016 by Member 8233601
Its really confusing to find difference between odata and entity framework. can anyone help me out to clear this difference and basic concept behind odata.What I have tried:I tried to google it but didn't get any clear picture.
18 Jun 2015 by Member 8353523
Is there any way to secure a WCF Data Service using User and Pass or Certificate? I am not interested in windows authentication as it is very insecure and let's say my client is running on Linux so it will be totally useless. I also CAN'T use cookies.
6 Aug 2015 by Member 9844487
I have two table Documents & Pageswith foreign key relationshipwhen i am using query in my WEB API../odata/Documents?$expand=Pagesin odata Results its returning---> [Docid=1,Name="My Doc",...,Pages=null]Why it's returning null value instead of expanding Page properties?
13 Aug 2018 by Mike V Baker
I'm working on a react-native prototype and trying to introduce react-odata. https://www.npmjs.com/package/react-odata has the following sample code in the readme file: const baseUrl = 'http://services.odata.org/V4/TripPinService/People'; const query = { filter: { FirstName: 'Russell' } }; ...
13 Aug 2018 by Mike V Baker
I learning react-native. I'm trying to display a really simple list of products from a database call. The data is loading but for some reason the individual items are not being loaded into the list. What I have tried: import React, { Component } from 'react'; import { Text, View, ...
13 Aug 2018 by Mike V Baker
So it turns out that it was just a problem of using braces {} where I should have used parens () render() { return ( { this.state && this.state.products &&...
13 Aug 2018 by Mike V Baker
As it turns out the call to odata was just fine, it was the syntax of the listitems that was wrong { data && { function(data) ( // PAREN HERE ) // AND HERE } } Switched the braces out and put in parens instead.
18 Oct 2012 by mohsen_alikhani
How to implement OData in ASP .NET MVC 4 Web API as same as WCF Data Service Using Visual Studio 2012?
18 Oct 2012 by mohsen_alikhani
If you followed this URL : OData support in ASP.NET Web API[]You will see that the MVC 4 Web API version alpha have solution for it but we want supporting it in finalized version !!!
19 Oct 2012 by mohsen_alikhani
The document of the following URL lays out a roadmap for ASP.NET MVC, ASP.NET Web API, and ASP.NET Web Pages : http://aspnetwebstack.codeplex.com/wikipage?title=Roadmap []
31 Oct 2012 by mohsen_alikhani
There is no full support for OData in web app at the moment.
12 Feb 2014 by Mousumi2708
I am using odata controller in mvc.While i am sending json data from ajax post method controller takes null value for properties of class my code like{"Id":"DdZLFwNe7vQ","ExternalInvestorId:"F1/11/Y14","AppKey":"5BB9B50E-AA2C-498B-B895-1E83827CE9F5",}in odatacontroller post...
27 Feb 2014 by Mudita Rathore
See this links i hope this will help you for creating OData support in Web API http://www.c-sharpcorner.com/UploadFile/2b481f/odata-feed-using-Asp-Net-web-api/[^]
13 Jan 2016 by NaVeN Kumar
Hi All,I am very new to OData service. I have created a WebAPi Odata Service with Entity Framework. I am able to get the data from service using HttpClient. I am trying to pass id value to find a record. I am not sure how to pass value to service.Below is my code:public string...
21 Aug 2017 by NaVeN Kumar
Hi, I would like to filter the records based on child table data using odata query. Example I have tables like below. Employee contains empId and Name, EmployeeText is having empId, languageid and Text Employees EmpId Name 1 Test 2 Test2 EmployeeText empId LanguageId Text 1 ...
28 Nov 2016 by Neal Pandey
This article is a tutorial on creating a basic OData (Open Data Protocol) endpoint for a MongoDB database using MEAN stack.
15 May 2018 by NobsterTheLobster
Publish a WCF DataService with entity model, updatable views, filtering and authentication
14 May 2018 by NobsterTheLobster
Consume data from a WCF Data service in a .NET client. MSAL OAuth 2.0
27 Jun 2015 by nonenameroot
Hello,I am trying to develop a solution based on a sql server database, entity framework and wcf (OData). I secure my data seen so how do use the sql server security levels (access rights and roles) or use wcf authentication, I'm really perturbed.Thank you in advance.
13 Jul 2012 by Nunnenkamp
http://crmDoma...
31 Jul 2013 by nwhitfield
Mobile, geo-centric app for Business Users, Consumers and Sales/Marketing Professionals
7 Apr 2013 by ompcj4u
HiI’m looking for a stable architecture for Commercial Projects like Accounting based on Network,Database: SQL ServerPlatform: .Net and C# Programming languageTechnology: Windows FormSo it's Contain at about 200 tables and Several hundred thousand Records, this software will...
13 Aug 2015 by OriginalGriff
Provided that the links to your site are to the database download itself only, it probably wouldn't be a problem. But...it would be better to add the database as a zipped download to the article itself, so it is hosted here. That way, if your site is down for any reason the article isn't broken...
1 Oct 2019 by OriginalGriff
Quote: I want to filter the record ... without primary key or without using any column name. You do realize that that request is just nonsense, don't you? You have a set of values in a table that you which to filter down to: in your case "Record_1" to "Record_100" which means that you have to...
21 Dec 2022 by OriginalGriff
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for...