在本地Azure模拟器上创建一个SQL Server数据库(不在网上)

时间:2022-12-21 03:55:42

I have succeeded in creating a basic tables running on the azure emulator in Visual Studio 2012 and I have also managed to create a couple of SQL Server databases that work with applications on a single computer. I was wondering how you would combine these to create a SQL Server database running on my local azure emulator ,that allows other computers and mobile devices to connect to it.

在Visual Studio 2012中,我成功地创建了一个在azure模拟器上运行的基本表,并且我还成功地创建了几个SQL Server数据库,这些数据库可以在单个计算机上处理应用程序。我想知道如何将它们组合在一起,在我的本地azure仿真器上创建一个SQL Server数据库,该数据库允许其他计算机和移动设备连接到它。

I have done a bit of research on this and there are quite a few topics about it, but it seems like you have to create the database on the Azure online portal and then connect to it, but I was hoping to skip this since I want to avoid connecting to any online resources.

我做了一些研究和有相当多的主题,但似乎你必须在Azure门户网站创建数据库,然后连接到它,但我希望能跳过这因为我想避免连接到任何网络资源。

If someone could just please point me in the right direction , because I'm still pretty unsure about using azure and all it's features. It would be great if I could create a SQL Server database on visual studio and then just specify a connection string to it through azure. (Must connect through Azure)

如果有人能给我指出正确的方向,因为我仍然不确定使用azure及其所有特性。如果我能在visual studio上创建一个SQL Server数据库,然后通过azure指定一个连接字符串,那就太好了。(必须连接到Azure)

"For local testing, you can use a local SQL Server (full, express or even CE) within your app - just use local connection string's in place of the SQL Azure ones in your .cscfg or .config files - then the local compute instance will connect just like any other local process would." Quoted from How do I test locally against SQL Azure?

“本地测试,您可以使用一个本地SQL Server(完整,表达甚至CE)在你的应用程序——只使用本地连接字符串代替.cscfg或. config文件中的SQL Azure的,那么当地的计算实例将连接就像任何其他当地的过程。”引用如何对SQL Azure进行本地测试?

I have read that question post, but the answer was a bit too vague for rooky programming knowledge. I think it might be able to help me if someone could also maybe elaborate on it.

我读过那篇文章,但是答案对新手编程知识来说太模糊了。我想如果有人也能详细说明一下,也许能帮到我。

Thanks in advance !

提前谢谢!

1 个解决方案

#1


0  

there is no emulator for Azure SQL Database.

Azure SQL数据库没有模拟器。

As the post you referenced pointed out, you use a local SQL instance (CE, server, express, localdb) to simulate your database operations.

正如您引用的文章所指出的,您使用一个本地SQL实例(CE、server、express、localdb)来模拟数据库操作。

when you're ready to move to Azure SQL Database, you just change your connection string to point to your Azure SQL Database instead of your local database.

当您准备迁移到Azure SQL数据库时,只需将连接字符串改为指向Azure SQL数据库,而不是本地数据库。

please take note though that Azure SQL Database and your typical SQL installation have feature differences, so that into account. you may be able to run some T/SQL on your local instance that is not supported in Azure SQL

请注意,Azure SQL数据库和典型的SQL安装有特性差异,因此要考虑到这一点。在Azure SQL中不支持的本地实例上,您可以运行一些T/SQL。

#1


0  

there is no emulator for Azure SQL Database.

Azure SQL数据库没有模拟器。

As the post you referenced pointed out, you use a local SQL instance (CE, server, express, localdb) to simulate your database operations.

正如您引用的文章所指出的,您使用一个本地SQL实例(CE、server、express、localdb)来模拟数据库操作。

when you're ready to move to Azure SQL Database, you just change your connection string to point to your Azure SQL Database instead of your local database.

当您准备迁移到Azure SQL数据库时,只需将连接字符串改为指向Azure SQL数据库,而不是本地数据库。

please take note though that Azure SQL Database and your typical SQL installation have feature differences, so that into account. you may be able to run some T/SQL on your local instance that is not supported in Azure SQL

请注意,Azure SQL数据库和典型的SQL安装有特性差异,因此要考虑到这一点。在Azure SQL中不支持的本地实例上,您可以运行一些T/SQL。