confused about local data storage for occasionally connected application in .NET - asp.net

Can I use a SQL Server Express database as my local database for an occasionally connected application (OCA) written using Visual Studio? Would that require SQL Server to be installed on the client machine? It looks like the default architecture for OCAs in .NET is to use SQL Server Compact. However, SQL Server Compact doesn't permit the use of stored procedures. I use stored procedures for all the data access in my application so, I am confused about the best way to create an occasionally connected client to extend the functionality.
I currently have an ASP.NET web application that connects to a web service (WCF). The web service connects to the DB and calls stored procedures to get data and submit changes to data. Now, I am trying to write a desktop application that can connect to the web service when a connection is available, and work locally when a connection is not available, using the MS Sync Framework. I don't quite understand how to do the architecture for this bit.

Yes, local data cache works with SQL CE 3.5 and you cannot use stored procedures on the cache. Once you add local data cache item to your project it automatically prepares all necessary MS Sync Framework code for data synchronization with the main data source + all necessary SQL scripts for local database and it will also offer you to create either typed datasets or entity data model to access the cache from your application.
Item doesn't work with SQL Server Express - it doesn't offer any other data provider then SQL Compact 3.5. Anyway if you want to use SQL Server Express you will have to either install it on the client machine or use another machine as DB server which breaks whole purpose of Local data cache.
Btw. I think Local data cache works only against database as the main data source so you cannot use it if you want to have WCF services as data source and you will have to write the store and synchronization yourselves.

Related

SQL always encrypted and dump of migration scripts for validation

I have two issues I can't figure out how to accomplish in Flyway without forking the repo and we'd like to avoid that.
Issue #1. Sql Server Always Encrypted connection, how do we override or inject enough information so that Flyway can setup the database connect to an Always Encrypted database. The connection needs to connect to Azure Key Vault to get a token for use for encryption/decryption but this additional setup that is above the the standard User Name/Password the connection string needs. Also, you can't pass these values on the connections string.
More details here on how this would be done in JDBC as I'm not a Java person.
Issue #2. Is there a way to retrieve the full list of SQL statements that are about to run during the migration and after all the "placeholders" are resolved? We need a way to check all the SQL scripts to ensure the scripts don't run specific commands such as CREATE USER, DROP DATABASE, etc. as we running this in a controlled environment and though that those commands work great during development, they can't be run in PRODUCTION. In Production the database user will have elevated privileges so we need to check the scripts before running them. I see the Dry Runs Pro feature but that just writes to a file. We'd like to get this data back on a callback and then we can validate it prior to the migration running.

Best way to handle a local SQL server communication with a cloud SQL server? (.NET Web App)

I have a .NET web-app (4.5) the app is a cloud app in the sense that it is hosted remotely and has its own local SQL data source.
The web app needs to talk to client SQL servers (in this case lets say my local SQL database). At the core the web app will request data from the remote SQL source and save it to the local SQL source, or the other way around the web-app may notify the remote SQL source that it needs to update a particular record, etc.
What would be the best way to do this?
I was looking at just doing a windows service on the client SQL server, and the web app makes calls to the client SQL box web service telling it what it needs to update or send over?
I started looking into WCF would this be a good application of WCF?
You may want to consider implementing an OData service as a WCF Data Service hosted in IIS that exposes data queried from SQL Server.
The following MSDN article provides an overview of a SQL Server OData implementation:
http://msdn.microsoft.com/en-us/data/gg192995.aspx
The following CodePlex link seems to provide good and relevant information pertaining to your scenario:
http://msftdbprodsamples.codeplex.com/releases/view/101644
Regards,

Track changes in client and send to server

I am planning a 3-tiered architecture in which I need to track changes to domain objects on the client (a Windows Store app) then send those changes back to the server (an Azure worker-role). I just found out about WCF Data Services which I can run on the client and integrate with Entity Framework Code First on the server. It looks okay but I'm wondering what other tools may also be available.
Are there any alternatives to WCF Data Services for tracking changes in client then sending them to server? If available, I'd like a solution that doesn't require generated DTO classes but instead sends the deltas alone.
Have you considered using rest services?
Im not an AZURE user, but use elsewhere.
Azure rest services docu

Using redis with SQL server

I am developing a web app and came across redis for key value storage. I do have a relational db SQL server. But as I have a multi tenancy system there will be separate schemas for each customer.
I was thinking how viable would it be use both redis and SQL server together? I was thinking of storing user Id and schemas so then can connect to SQL server db for that user
It's perfectly viable to use both Redis and SQL Server together.
With more details about the kinds of schema differences you expect, we might be able to provide more insight.

OData Service for SQL Azure read only?

according to here: http://watwp.codeplex.com/wikipage?title=Architecture%20Diagrams
The SQL Azure OData Service is a sample WCF Data Service built on top
of a SQL Azure (or SQL Server) database using Entity Framework 4.1
Code First.
The current version of this service only supports Read operations and,
in addition to exposing the SQL Azure database as an OData feed, it
adds a security layer to manage authentication / authorization.
so does it mean the my windows phone app will only be able to read from sql azure and not write to ? or can i do it by creating a data service on the asp.net server ?
i'm a little confused.
What this is saying is that the sample OData service that they provided only implements read operations. If you want read and write, you're going to have to roll that yourself.

Resources