C++ connection to Azure SQL or Microsoft SQL Server

人走茶凉 提交于 2019-12-11 14:53:49

问题


I am trying to establish a connection to a database in my C++ code; however, I am unsure how to do so. My database is Azure SQL which uses microsoft sql server as the backend. Could someone provide me a website or code that executes the connection with the server name, database name, username, and pass?

Thank you


回答1:


To find the connection string, first login to Azure portal, then click your database > Show database connection strings, and you'll see the connection strings for ADO.NET, ODBC, PHP, JDBC.

For c++ code sample of connecting to Azure SQL Database, you can refer to this article https://msdn.microsoft.com/en-us/magazine/dn630643.aspx , use the ODBC connection string of your database.



来源:https://stackoverflow.com/questions/35556143/c-connection-to-azure-sql-or-microsoft-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!