I'm writing a C# application that needs to be able to query and update an Azure SQL database. I've looked into ADO.NET, which appears to be a great library for querying SQL databases without just writing the queries as string literals.
Before I invest too much time into learning this library I want to make sure that I can connect it to Azure successfully. I found this article which appears to have at one point contained a tutorial for doing exactly that, but doesn't exist anymore. Can anyone confirm that ADO.NET can be used with Azure SQL?
Yes, Of course we can.
ADO.NET can be used with Azure SQL, we can use ADO.NET to operate Azure SQL just like we operate SQL Server. But there are some differences between Azure SQL Db and SQL Server, we can refer to: Feature comparison: Azure SQL Database versus SQL Server
We can also use Linq to SQL to operate SQL Azure for some simple operations because it is more convenient to operate our database. More information we can refer to: LINQ to SQL: .NET Language-Integrated Query for Relational Data
You can and you can find the connection string to use in the Azure Portal. Here's a guide:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-connect-query-dotnet-visual-studio
Related
I would want to sync up on-premises Oracle database with SQL Azure. Currently I have a DTS package setup for my on-premises applications (both Oracle and SQL Server being on-premise). If I move the SQL Server to Azure, how should this process be designed?
you have to options for moving to Azure:
Move to Azure SQL Database
Provision a SQL Server VM in Azure
the latter will have the same feature set as your regular on-premise SQL Server. The former is not fully-feature equivalent to SQL Server. Azure SQL Database is just the Database engine part, no SSIS, SSAS, Replication and even TSQL is not fully equivalent to SQL Server.
If you use the VM approach, its safe to assume you can still run your existing packages. However, you need to consider latency between Azure in the cloud and your on-premise Oracle database.
you may also build a custom solution to sync the databases or even use Sync Framework. see: Database Sync: Oracle and SQL Compact 2-Tier , just replace the SQL Compact with the SqlSyncProvider which works with the Azure SQL Database. You can change the sample to use an n-tier approach if you want to use WCF as well.
There are few differences between SQL Server and Azure SQL Database (SQL Azure renamed) so I suppose your code can work on Azure too with little effort. Azure SQL Databases do not have the same features and AFAIK the DTS package cannot run in the Azure environment. But I suppose you can think, if logic/traffic/latency permits, of running the DTS on premises interacting with the Azure SQL Database and Oracle.
You may find SQL Data Sync interesting:
SQL Data Sync is a web service that you use to keep your data synchronized across multiple servers in different locations
How to migrate database from sql azure to another DB server such as oracle for a single application hosted in windows azure for one client sql azure and for another client oracle as DB Server?
Your question is not very clear, but in most cases you can use the SQL Azure Migration Wizard when you want to migrate to and from the cloud.
The SQL Azure Migration Wizard (SQLAzureMW) gives you the options to
analyzes, generates scripts, and migrate data (via BCP) from:
SQL Server to SQL Azure
SQL Azure to SQL Server
SQL Azure to SQL Azure
As Sandrino mentions, question not clear, you could always use a BACPAC export to blob storage.
How to: Export a Data-tier Application (SQL Azure):
http://msdn.microsoft.com/en-us/library/windowsazure/hh335292.aspx
I prefer this option over the Migration Wizard, but have to say its a great tool!
*Note the SQL Database Migration Wizard is not supported, still an excellent tool and never failed me :)
http://msdn.microsoft.com/en-us/library/windowsazure/ee730904.aspx
I'm developing a WPF application, which connects MS SQL2008 database remotely.
The app communicates with the database by Linq-to-SQL. pretty handy.
However, because of the slow database server, I'm trying to use local database caching.
"VS2010 > Add Item > Local database cache" wizard could be a solution, but it uses DataSet and SQL Compact(*.sdf).
I found Linq-To-SQL cannot generate classes from the SQL COMPACT edition!
(when I drag tables, error pops up and says 'unsupported data provider')
So, is there any solution to use Linq-to-SQL with local database cache?
or is there any database sync method played with Linq-to-SQL?
If you still want to go the sql compact way, Lightspeed is a linq-to-sql provider that supports a variety of data-sources. it includes mssql compact.
http://www.mindscapehq.com/products/lightspeed
The free version is sufficient for most projects, with an 8 model/class limit.
Ive used it as a linq provider for MySql and Sql Compact before and it's been great.
You can see everything it supports and how it compares to other existing systems like it here:
http://www.mindscapehq.com/products/lightspeed/comparing-lightspeed
the Local Database Cache Wizard only supports SQL Ce on the client side. if you have SQL Express/SQL Server on the client side, you can use Sync Framework still.
see following samples/tutorials using Sync Framework:
Synchronizing SQL Server and SQL Express
Database Sync:SQL Server and SQL Express 2-Tier
nevermind if it mentions SQLExpress, the SQLSyncProvider referenced in the code should work against SQL Express,SQL Server, and SQL Azure
We want to allow access to our custom back end data store by pretending to be an ODBC server such as Access or SQL Server. In this way, anyone with those ODBC drivers could connect and send us queries (from anything from asp.net to Excel) which we will resolve on the back end and return a result set.
I have the ability to parse SQL and return result set based on a dynamic sql query. What I don't know is how to pretend to be an ODBC or OLEDB server. I don't even care which server we mimic as long as it's a common one that has drivers that ship with windows.
I have searched but could not find a basic implementation that implements authentication and ExecuteQuery() methods. Does such a .net project exist?
You could implement an ADO.NET data provider?
see http://msdn.microsoft.com/en-us/library/a6cd7c08.aspx
The System.Data.Sqlite project is an excellent example of how to build an ADO.NET data provider for an arbitrary data store.
I am developing an application in C#/WPF that requires a distributed data model, as it will have both online and offline access.
My current thoughts are to develop the first version of the application against SQL Server express and LINQ to SQL. Then use the schema to create a SQL Express Compact DB (and modify the connection string) for distribution.
Once that version is how I like it, I will add the "distributededness" to the application by creating a web service that the application syncs its local database with.
My questions are: is this a good approach? And will I run into problems by turning my reference to a "real" SQL server into a reference to a local self-contained SQL database file? I had issues trying to create LINQ to SQL with a compact DB reference, but I can't see how it is different then a reference to a "real" server.
Thanks
At the moment I am considering this:
http://www.mindscape.co.nz/products/lightspeed/
Then use LINQ to SQLITE for my application.
Are there any comments on this approach?