Using ADO.NET in UWP apps possible? - c#

I am trying to use ADO.NET so that my C# UWP app can access my Azure SQL database but when I try to refer to "System.Data.SqlClient", it is not readily available. I tried importing the "System.Data.dll" file but that led to a new host of errors.
I'm being led to believe that ADO.NET is not compatible with UWP apps. The problem with that is that I can't find another technology that will allow me to work with my Azure SQL database. Am I missing something here?

The best way to handle this is to create a full web api solution.
So, at the end, you will have
An Azure SQL Database
A Web API website , which will expose your datas in a JSON format. Using Entity Framework is not mandatory but can help in some way :)
An UWP application which will request your Web API endpoints
You will find here a complete solution : http://www.asp.net/web-api/overview/data/using-web-api-with-entity-framework/part-1

Latest UWP platform offers connectivity to SQl Server .
Please refer
https://learn.microsoft.com/en-us/windows/uwp/data-access/sql-server-databases

Related

Create Web API using SQLite .NET 4.5

I want to create a Web API in .NET Framework 4.5 (hosting enviroment that we are using requires only .NET 4 or 4.5 and not Core) using sqlite database. What is the right way to do implement a web api and connect it to the sqlite database in a way to deploy it directly through plesk? Please have in mind that we do not have a dedicated server and we are going to use Plesk to upload the published API.
Thanks in advance
I have already created the api, but I want some help with the creation of sqlite database and use of tables so to deploy it through Plesk.
Use google and reseach. It's not a single issue.

How to connect my new Xamarin application to an existent azure DB?

I started developing a new Cross-Platform app with Xamarin.
For other projects my teammates created an azureDB with certain tables that I want to Query for my new Application. Can anyone tell me how to connect my new app to the AzureDB?
Thanks!
The recommended way to connect to the database is using an API that will manage the interaction with the database. On this article you will find how to build a REST API to access an Azure SQL Database.

Getting help from web cloud services (calling from asp.net mvc site)

I have a website, but some of the back-end infrastructure is little slow.
So I am planning to get help from CLOUD, I haven't decided which one yet.
I need to know does Microsoft Cloud does the same thing.
What I need is following,
1) Have database on external web resource.
2) Have code and http enabled methods that I will write in C# and place it on Cloud.
3) And call the methods in step 3 from my asp.net MVC wesite's codebehind and client side(javascript).
I need to know if I get support from Microsoft Cloud platform, will I get the solution required in above 3 mentioned points?
And if I get support from Microsoft Cloud, then the coding syntax for SQL, will be same as if I run queries against normal SQL Server database
Thanks,
If I am understanding you correctly in that you are looking to have a cloud hosted SQL database and HTTP access to this database through custom C# code, then yes to all three of these.
You can set up your database as an Azure SQL database and create an ASP.NET WebAPI application to open up your database to HTTP calls as you see fit. Then you can use the REST client of your choice to access your database from your MVC controllers or through Javascript in your views.
Also, yes, SQL syntax for Azure SQL is the same as for regular SQL Server.

How to connect to a SQL Server database already hosted on server with windows phone 8

As I'm not that skilled in Windows Phone 8 development I would like to discuss/ask what is the best way to connect my Windows Phone 8 to a SQL Server database, I don't want to use Azure as I have already have the database present on server using for website. Please can anyone give me complete tutorial for the same or help in achieving it? And after connection, I want to fire select queries only from wp8 app using text box inputs from user
Check here Windows Phone 8 access to SQL remote Database
Microsoft does not allow direct connection to remote databases, so you need to have a service ont the server connected to the database, that serves the content with http requests (using xml or json to represent the data)
The best way to do this is using Web Services. In web services you can use ASP.NET Web API. Its a framework that makes it easy to build HTTP services that you can use on your windows phone, JSON or XML, you decide. In your windows phone you can use a GET, PUT, POST, and DELETE request and get the WebAPI response appropriately.
You can implement one by using these tutorials:
Tutorial
Another Tutorial.
I prefer using LINQ to query data in Web API using linq
Linq Samples
For sorting purposes you can use odata:
Odata for ASP .NET Web API
To consume the Web API :
Web API with windows phone
you can also make a simple web page that takes data from your phone as query string and return data as response, this web page should work as a bridge between you and your database. and you won't have to open the page from your phone, you will just send an HTTP request and get the response , this might help you : https://msdn.microsoft.com/en-us/library/hh221581.aspx

ASP.NET website to be deployed on Windows Azure with databases

I know this is a very common question and I could find several answers, but I think my situation is a bit different.
So, I have an ASP.NET Website (NOT a web application), built using "Web forms". Its a very simple website which does bunch of REST calls and talks to the SQL Server 2008. Can you please help me finding a step by step guide to deploy the same on Windows Azure using VS 2010? As of now, the website runs fine on a traditional web hosting server.
So far what I am getting are approaches which use MVC (and using ASP.NET web application, not website). I don't think that I should be concerned about MVC at all? Does a website vs. web application aspect make a difference? If yes, do I need to convert the website to web application?
There's a lot of content on web, so I am a bit confused given my condition. Can someone please put me in right direction? Thanks a lot.
You'll need to convert your Website project to an ASP.NET Web Role project, whether you first convert it to a ASP.NET Web Application or not doesn't really matter. The rest of the tutorial you already linked to applies just fine.
There's no need to look at ASP.NET MVC, It's a different technology than web forms, and there's no need to move to it in order to get your site hosted on Azure.
As for your database, unless you host that yourself in a VM-Role or somewhere else (and connect it using Azure Connect), you'll need to convert it to Sql Azure or Azure Table Storage. SQL Azure is largely compatible with SQL Server, but there are a few features which are unsupported.

Categories