MySQL连接字符串Windows Azure [英] MySQL Connection String Windows Azure

查看:145
本文介绍了MySQL连接字符串Windows Azure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,



我想知道是否有办法使与Windows Azure发布配置文件的集成受益,并在我的代码中静态使用其中的连接字符串。



我的意思是我必须引用一些集合或一些XML内容,并在将代码部署到服务器上时,实际的连接字符串值部署目标的内容将嵌入到代码中。



有没有办法可以实现这样的目标?不需要处理连接字符串值,将来可以节省大量潜在的错误和调试时间吗?



非常感谢。

Hey,

I was wondering whether there is a way to benefit the integration with the Windows Azure publish profiles and use the connection strings within them statically within my code.

I mean that I would have to refer, lets say, some collection or some XML stuff, and while deploying my code onto the server, the actual connection string value of the deployment target will be embedded into the code.

Is there a way I could achieve something like that? Not having to deal at all with the connection string value, saving lots of potential bugs and debugging hours in the future?

Thanks a lot.

推荐答案

您可以将连接字符串和其他设置配置为azure网站环境的一部分。你可以在网站下的配置选项卡中执行此操作。



这里有两篇博客文章描述了如何做(它的用于php,但它几乎是相同的.net):

获取-database-connection-information-in-windows-azure-web-sites.aspx? [ ^ ]



商店DB-connection-info的功能于Windows的蔚蓝-web-sites-app-settings.aspx [ ^ ]
You can configure your connection string and other settings as a part of the azure web sites environment. You do this in the configure tab under the web site.

Here are two blog posts describing how to do (its for php, but it is pretty much the same for .net):
getting-database-connection-information-in-windows-azure-web-sites.aspx?[^]
and
store-db-connection-info-in-windows-azure-web-sites-app-settings.aspx[^]


这篇关于MySQL连接字符串Windows Azure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆