I have a project assignment from the university and want to ask you if you can show me the right approach. I'm not asking for any code or to write me something. I just want some guidelines to follow.
Firstly, to explain a bit.. I have to design and implement an Info System in .NET. It should have a Desktop App (based on Windows Forms), a Mobile App (Windows Phone 7.1) and a database (MS SQL). The idea is to have a database, hosted on a remote machine. The desktop and mobile apps should be able to connect to that database and do some stuff with it (mobile app will be only for viewing data, not modifying). The system must be multi-client - the database should be able to be accessed from multiple desktop and mobile clients at a time.
I'm ready with the GUI and it's time to do some real work. What's the easiest way to get that communication done? I thought of a WCF Service Application, which will provide the clients' access to the DB. My idea is to have the database and the service on a machine with a public IP address. The apps (desktop and mobile) will connect to that machine and respectively to the SQL through the WCF.
I saw some tutorials around, but didn't find one that shows how to make that WCF Service work with both Windows Forms app and Windows Phone app. I'm not very familiar with WCF - should I have IIS to run the service? I'm also not sure what kind of techniques I have to use on the client side to do the connection...
Is this approach rght? Can this be done in the way I explained? What should I be aware of? I will appreciate every kind of advise and reproach.
The easiest (and in your case, most efficient) way would be to use Windows Azure. For the purpose of your project, you can always sign up for the free trial.
Specifically, you can leverage Windows Azure SQL Database. Or, if you are so inclined, you could use Mobile Services, which also relies on SQL databases but you will have a much better time setting it up in your Windows Phone app (doesn't matter whether you want to read or write data).
Related
I'm working on a project and I need to connect to MS Access Database. The problem is that I'm using a pretty new platform , I'm using Visual Studio 2015 Xamarin and I'm developing to android with c# (thought this platform).
I already have a project with this Database using aspx and i need to connect the android application to this Database .
I could not find any answer for it , probably cause it's new .
Thanks for helping.
The problem is not related only to Xamarin or MS Access.
Everytime you want to use the same database in different applications (in your case a website and mobile apps), it is better to create a new layer (WCF Service or REST API) in order to access the same database on the server. This is more flexible and would be the right thing in your case.
Without moving the architecture to the next Level, you will always have such problems when mixing old and new technologies together.
If you just want to finish this quickly for school and use the database only on the device, then there is no way to use the MS Access database with xamarin. I recommend using SQL lite for this and there are lots of examples for that:
https://developer.xamarin.com/recipes/android/data/databases/sqlite/
It not clear if the database is to run “local” on the android, or you just wishing to connect to some web service that holds the database?
If you needing a local database to run 100% stand-alone on the Android device, then Access is not supported. Your best bet for a local database would thus be SQLite.
Perhaps you don’t need nor want a local data store. In this case if the Access database is on the server, then you would be forced to write some kind of web service to “interact” with your Android software and the web server (this would not be a "general" interface to the database, but a set of web services that you expose on the web site - this assumes you thus have control and are able to write software and implement a web service on the web site. So in this case some kind of “direct” connection to the Access database is not possible.
You could again certainly DIRECTLY connect to a server based database like SQL server – but this would assume the web hosting allows external ODBC connections to the database (often they don’t allow this, but some do).
So not clear is if you need a local database running on the Android that can THEN connect to some web or server based system, or you simply want the android to connect via the internet to some database hosted on some server and the Android device does not have a local database at all.
Regardless of the location of MSAccess, you cannot "connect" to a non server database like Access. So the question remains as to "where" you want this database to be used, and ALSO if you need a local data store on the Android device or not.
I'm developing an application that will run on a couple computers and phones(android, iPhone, Windows phone) as a client and 1 computer act as the host for data and do some calculations all of this happening in the local network but I dont really know what's the best way to do this.
I'm thinking of something like a Windows service that will use a database for storage of variables settings for each user etc.
So my question is what should I use wcf, sqlserver or something else?
I'm pretty new in developing pc and mobile applications that need to work with the same database.
Maybe this isn't really a question but I would be happy to get some advice from you.
I have now a vs project written in C# with a Service-Based Database. I want to create a mobile app (can be only for android) and I want both the apps to use the same database.
What options do I have? Windows Azure isn't free and I can't spend any money on this so even a small trial (limitless) will work here.
I was thinking using Parse..
What do you recommend?
If I understand correctly I would suggest you create some backend service - web service or web api - that both application use which in turn uses the database.
This will allow you to re-use business logic across both applications, abstract the database away so that you can make database and logic changes without having to redeploy the applications and avoid the requirement to deploy database credentials with your applications (the backend service should employ some form of authentication)
A free-tier Azure mobile services can really help with the mobile device end but not necessarily on the PC (unless windows store app), but a free-tier Azure websites instance will happily host either web service or web api
I'm quite new at using Monotouch and I want to make an app that can connect to my personal MySQL server at home.
I know how to do it in VS2010, but is it possible in MonoTouch?
It will be really helpful if you have a example.
First, I am not sure if you can access a MySQL database directly from Monotouch or not.
However, even if you could, unless you are just using the database on your home network, it probably isn't a very good idea to expose your database to the internet.
I would suggest creating a web service using Visual Studio that performs all of the database interaction. You can then just expose the functionality that you need through the web service and use that web service interface from Monotouch.
Although there will be a bit of a learning curve to start with, this will definitely be a better long term solution.
My solution is to host an small server at Amazon Cloud, where i have both my web service and an SQL server running. An bonus to that it's quit cheap. From my iPhone App im using WCF communication.
We had a requirement to build a ASP.NET 3.5 web application using web forms, WCF, ADO.NET and SQL Server. The users would connect via Internet.
Recently we understood that it is possible that users would often remain disconnected and would have Internet access intermittently.
I need to understand if we can create occasionally connected web application using asp.net 3.5 - what all technologies/features we need to use? Is MS Sync Framework the answer to the problem - is it a viable option to use with web application?
Is windows application the right approach instead of web applications - where the business logic would be run at the client itself, using local SQL Express editions with data then been synced up with Enterprise SQL server at server end when connection is established using replication and/or MS Sync framework. In that case is there a need to use WCF?
Does Silverlight applications help in this context -building paritally connected web apps?
Really appreciate if you can give pointers to how to go about this task of creating .net partially connected apps (not mobile apps)?
It looks to me as if you'll need to store your client data locally when not connected.
If you use wcf you can determine what type of protocol to use according to connectivity without affecting your main code e.g. tcp/ip for LAN, http for internet and msmq for storing up data when disconnected.
If data for transfer is stored up using msmq, as soon as a connection is remade then the data will be passed to your main server.
If you write your wcf, or communications code to run as a service (assuming windows functionality here) then it is up to you whether to retain the asp code or write a new windows app.
edit
Setup MSMQ at both ends, its part of windows setup and can be installed on a client machine, just the same as IIS is, it's on the installation disk but not installed by default.
I wouldn't use it to get web pages, have those available on the local machine, but instead use it to queue up data that MUST get back to the server. Your data access layer should be separated from your GUI layer anyway. I assume that your using the MVC pattern or similar.
I don't know what your application is requried to do but here is the example that I've worked on.
A mobile user who visits clients. He has a replicated copy of a company product database on his laptop. When he visits client sites he may not be able to connect to his company server, but still wants to place client orders. This he does using his laptop based application and database. Order data is queued up in MSMQ on the laptop.
As soon as he is able to connect to his company server MSMQ automatically sends the order data. The server has queued up MSMQ messages of changes to pricing and stock etc. that took place whilst he was disconnected. These are now received and the local database is updated.
The choice of TCP/IP, HTTP or MSMQ all happens seemlessly to the main application, the WCF code copes with the choice.
From what I know, you have two options:
Use Gears (abandoned) or Web Storage to store and sync local data, combined with heavily javascripted web pages that can detect loss of connection and work against the local data store.
Use the Sync Framework with a rich client (WinForms, WPF or possibly Silverlight OOB if it gets supported). The Sync Framework does not require a local installation of a database, instead it uses SQL Server Compact, which is simply a local file.
At this stage using Sync franework with probably rich client seems to be better option. Thanks a lot Guys for taking your time out and trying to answer my queries. I will let you know the technologies used after i manage to deploy the app!