通过OS X上的连接字符串连接到SQL Server [英] Connect to SQL Server via connection string on OS X

查看:64
本文介绍了通过OS X上的连接字符串连接到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Xcode中用Objective-C进行编码已经超过2天了.所以,如果我很愚蠢,请原谅我.我来自C#/.NET背景,希望将当前的解决方案从Windows平台扩展到Mac.我一直在搜寻有关此要求的答案,而我想到的只是创建易用的Web服务".但是,我不想这样做.

到目前为止,我的应用程序可以解析JSON并通过命令行发送. JSON中的对象之一是SQL连接字符串.现在,我需要能够:

  1. 基于包含我的SQL连接字符串的NSString,创建到简单SQL Azure数据库的开放连接
  2. 使用参数执行查询
  3. 关闭并处理SQL连接

任何人都将受到感激

解决方案

感谢您的回答,尽管确实如我正确指出的那样为我指明了正确的方向,但是Microsoft没有用于Azure的OSX驱动程序./p>

由于这个原因,我感觉到最初的问题,即连接到SQL Azure数据库的问题尚未得到解决.

我相信最好,正确的方法是做我最初不想做的事,并为数据库调用我的应用程序所需的消耗品建立Web服务.

我很抱歉没有尽快批准您的回复,这是一个疏忽,我不想无礼.

再次感谢您的回复邮件

I've been coding in objective-c in Xcode for just over 2 days now. So please forgive me if I'm being stupid at all. I am from a C# / .NET background and am looking to extend my current solution from Windows platforms to Mac. I've searched far and wide for an answer to this requirement, and all I came up with is 'create a consumable web-service'. However, I don't want to do this.

So far, my application can parse JSON and send in via command line. One of the objects in the JSON is the SQL connection string. Now I need to be able to:

  1. Create an open connection to a simple SQL Azure database, based on the NSString containing my SQL connection string
  2. Execute a query, with parameters
  3. Close and dispose of the SQL connection

Any and all help is appreciated

解决方案

Thanks for your answer, and even though it does point me in the right direction, as you correctly stated, there is no OSX driver for Azure from Microsoft.

Because of this reason, i feel the original question, to connect to a SQL Azure database, has not been answered.

I believe the best, and correct, way to proceed is to do what i originally did not want to do and set up a consumable web-service for the DB calls my application required.

My apologies for not up-voting your response sooner, it was an oversight, I did not intend to be rude.

Thanks again for your reply gaige

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

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