Examples of WCF CRUD operations for Oracle? - wcf

I'm working on exposing access to an Oracle database table for a SharePoint implementation.
From what I've seen, Oracle is not directly supported by BDC, so I'm trying to write a WCF service to perform the CRUD operations against my table.
I've been researching on Google with very limited success. Can anybody point me to an example of using WCF to modify data in an Oracle database?

I was able to figure this out by following this tutorial (leaving out the Silverlight stuff since I didn't need Silverlight)
How to connect to Oracle database using WCF in Silverlight

Related

Do Azure Easy Tables support relationships?

I'm just learning about Azure Mobile Apps. Do Easy Tables support relationships? My existing schema has multiple tables with foreign key constraints, and I need the ability to create complex joins (Easy APIs). I'm trying to understand the point of all this "Easy" stuff.
Should I skip it and just create a custom ApiController and manual db script deployment?
Easy Tables are just simple SQL Azure tables that are exposed through a Web API OData Service endpoint. So when you create them you can connect to the SQL Azure and create your relationships etc there and customize the API code to include those relational data in the response.
From my experience they are good if you dont have complicated logic/business rules or complicated queries.
To my experience if you have complicated stuff even normal Web API OData Service endpoints would not help because the interception of the requests makes the code complicated and you are better off creating your own Web APIs.
I almost feel like the Easy API and Easy Tables are more designed to give you a kick start for a simple mobile app in a hackathon or to put an idea together as a demo real quick. But for real life enterprise stuff I will go with building my own Web API.

Create Table in Azure SQL Server for mobile services (.net Backend)

I am creating table in Azure SQL Server using mobile services webservice (.net backend). But table is not created in SQL Server.
My questions are:
Can I create table manually in Azure SQL Server?
If I can create table then there will any possibility of error?
Is there any possibility to find out why table is not creating?
Please provide your suggestions how to solve this
If you are using the .NET backend, you are operating in Entity Framework for table management. You will likely need to do an EF Migration to create the table - there is no dynamic schema / table maintenance. It's best to learn Entity Framework and go from there.
Specifically:
1) Yes, you can create the table manually in the SQL Management Studio.
2) You will need to define the appropriate table within your .NET backend as well. The schema must match what is expected. You can't just take any old table and expect it to work
3) You can turn on logging in the Entity Framework and see the underlying SQL statements and errors being returned by SQL Server. However, your problem is likely to be because Entity Framework hasn't run a migration.
Thanks for your answer.
Table has created by using mobile services.
Actually table has been created by using mobile services but it was not displaying in sql server. To display table in sqlserver i have to do action (like insert,update data) in atleast one table. then all table display.
Yes you can. If you use Mobile Services, go to the dashboard and Configure - here, you will see the database server link. Go to that, and get the connection string. Then, you can connect with something like, for example, SQL Server Management Studio 2014 (i would recommend to do that to avoid any support inconsistencies) and do what you want with the database (with some limitations, however). You may do that using Visual Studio as well.
If you use Mobile Apps, go to the Mobile App dashboard, then Data Connections - here, you will see the hidden connection string that you can use for connecting the same way as described above.

How to get/set information in an SQL database via internet connection

I'm currently creating an SQL database that will eventually be accessed by web applications, both mobile and desktop platforms.
Setting up the SQL database is easy.
What I'm currently having trouble with is how I'm going to allow clients to access to information in the database without having direct access to the database, for security purposes.
For example, let's say I have a list of employees, and I'm creating employee profiles for a mobile application. I would like for the mobile application to be able to use a function such as get(employee_name), which will call the database and retrieve the information about the employee in the form of a JSON.
How would I go about doing this?
To see a very nice solution on using JSON on sql server tables please look at Phil Factors article Consuming JSON Strings in SQL Server at:
https://www.simple-talk.com/sql/t-sql-programming/consuming-json-strings-in-sql-server/

Data provider class for sql database

I need to write a data provider class to pull data from a sql database for use in a webpage that will display a bing map. Does anyone have a link they could provide with a tutorial on how to do this?
I have very little experience using a db to provide dynamic data for a web page so any help is appreciated. The Database is a sql Azure databse.
You need to research Data Access in .NET and ORM technologies for .NET. This question deals with similar concepts.
Simple Data Access Layer
Note: There is nothing "special" you need to do to apply the standard .NET data technologies to Azure SQL.

ADO.NET Data Services & Oracle - RESTful WCF w/ Oracle

I'm looking into WCF and woud like to created my framework in a RESTful way. I've just started looking into ADO.NET Data Services, but it seems it only supports SQL Server, is this correct? Can you run in against Oracle?
ADO.net Data Services and WCF both feed off a model. You can provide restful access to your data using a proper model layer that accommodates Oracle driver. Things might not work out of the box. In WCF you can use an Oracle friendly mapper like NHibernate and expose your datacontracts in a restful way. For Astoria you might need to hunt for a EF provider for Oracle db. But its possible.
EDIT: It seems ADO.net Entity Framework is already Oracle friendly ! You have no problems going pure WCF or Astoria way
Please see the following question for a more up-to-date and thorough answer.
Is it possible to expose data from Oracle using OData?
ADO.NET Data Services relies on the ADO.NET Entity Framework, and that definitely also supports Oracle. WCF in itself is totally database-agnostic - no limitations here. I don't see why you shouldn't be able to use ADO.NET Data Services with an Oracle backend.
Marc
Here's a link on how to do so -
http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkWCF/WCFEntityFramework.htm
You'll actually need to install ODAC for EF, which is currently in beta:
http://www.oracle.com/technetwork/topics/dotnet/downloads/oracleefbeta-302521.html
It works fine for me in VS, but not in IIS, which is the issue I'm facing.
HTH