Using Realm for Xamarin Forms with a preexisting SQL database? - sql

We have a preexisting SQL database that holds our data and will be updated from time to time. I've just stumbled across Realm and don't quite understand how it works at the moment.
From the examples I've seen it looks as if Realm creates the database locally on the mobile device (please correct me if I'm wrong). This is not what we want. We want our data to live on some server and then pull that into the application.
Can this be done purely with Realm? Or should we somehow pull from the SQL server? What's the best way to achieve this?
Thanks!

Related

how to have database offline for iOS app

I would like to develop dictionary app for iOS application. and I am not sure which database Managment system should I use to store data. I want to my app to be offline so even user that don't have internet, they still can use my app. so my question which database should I use to store my database ? I research on google, it said sqlite. so if i store my data in sqlite so will my data in database sqllite will go with my app? thank
Yes, sqlite is your DB of choice unless you're just working with a couple of dozen records.
If you plan to use CoreData, you can also address sqlite with it.
If you don't plan to use CoreData, you can still use sqlite and work directly with the DB. There are good wrappers which help you, like FMDB: https://github.com/ccgus/fmdb

Remote MSSQL/ODBC Syncing With Rails

I am working with a client that has data in an MSSQL database. I only have read access to a remote ODBC connection and cannot modify the database in any form.
I'd like to replicate a subset of the data locally in an open-source alternative, syncing once per day or so. This is largely to eliminate reads against the data during peak hours. The local data will be used in a Rails 4 application. Note that syncing only needs to be one-way, as I don't have write access.
How can I best accomplish this?
FreeTDS?
Are there any libraries that will help with the syncing, or can I expect to write all the glue code myself?
I would advise you to create a ruby script that can be scheduled to do the data retrieving.
In order to connect to the MSSQL database, please take a look at this simple project I've created.
Then you only need to code the data you want to retrieve and the way you store it.
I prefer the approach of being decoupled from your rails application, although you can use a scheduler like rufus-scheduler or sidekiq and run it with your application.

Integrating Sybase UltraLite Db to my code

I am new to ios development. I want to create a local Sybase Ultralite db in my system and
want to perform insert , delete,update on my local Ultralite db present in my system. I went
through many samples, but I didn't get any proper information. For integrating SQLite db there
are many step by step approaches which is easy to follow but for Ultralite none. As I am a
beginner I want step by step approach to create a simple local Ultralite db in my system and
modify it through my code . I really need this very badly.I am using Ultralite db because
there are multiple users of my db, and data they are updating will reflect in the server
also. Where as in SQLite I dont think, it provides this kind of sync mechanism. As far as i
have heard it is used as just a local db Can anyone help me on this?
SQLite (or Core Data) are definitely the most common SQL interface for iOS. But you're right that it doesn't offer any built-in, integrated, sync mechanisms itself.
In terms of Ultralite on iOS, have you seen the Ultralite iOS tutorial page? It's not much, but a start.

Best method for transferring data between two SQL databases

I'm developing a project for gathering customer feedback using a Samsung Q1 Ultra, a cheap touchscreen PC. The project consists of two parts: a PC based application that builds the survey and stores the info on an SQL Server, and a survey viewer on the Samsung device which downloads survey data from the SQL Server and stores it on a SQL Server Compact 3.5 database.
My question is, how best can I transfer survey data from the SQL Server to the handheld device's database? Writing a tonne of code to copy data from one database to another seems overcomplicated - is there a handy function or somesuch that I can use to copy data from identical tables on these two separate databases?
Any help, suggestions greatly appreciated.
Cheers
Since you are copying from one device to another, you're going to need to do some sort of transfer system (replication, export/import, etc.) obviously.
My initial suggestion would be to have the handheld devices just access the main database on the server remotely... This means that each of the individual handheld devices (should you add more than one) would be working from the same data. Other than that approach, I would suggest something like this (after adding a linked server entry):
select * into targetTable from [sourceserver].[sourcedatabase].[dbo].[sourceTable]
A quick search on Google actually returned a question similar to yours here on the site.
SQL Server Replication might work for this. That MSDN section has tutorials, how-tos and walkthroughs. It isn't all that difficult to understand, but there is some setup. However, once you're done, you can basically put it on automatic pilot.
This article is a pretty good overview.

Multiple databases with NHibernate

I have the following scenario - Our desktop application talks to a SQL Server on another machine. We are using Nhibernate 2.1.2. Now, we want to use SQLite on client machine to store data which could not be uploaded. For example, if Order table has not been updated on SQL Server, we want to save it to SQLite. And, then later try to upload to SQL Server. So, we are thinking to use Nhibernate for storing data in SQLite. How do I configure NHibernate to achieve this?
thanks
You will need to create a whole new session/session source. NHibernate can not simply switch contexts with the push of a button. Best bet is to spin up a separate repository and session that point at that specific second database.