如果我使用SqlConnection,我应该使用哪个连接字符串? [英] Which connection string should I use if I use SqlConnection?

查看:84
本文介绍了如果我使用SqlConnection,我应该使用哪个连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

https://www.connectionstrings.com/sybase-adaptive/

它是  Adaptive Server Enterprise,所以我想我只能选择  Sybase ASE OLE DB提供程序 或  Adaptive Server Enterprise ODBC驱动程序
如果我要使用 SqlConnection con = new SqlConnection(" Connection String"),那么我应该使用哪一个?或者没关系?

It is Adaptive Server Enterprise, so I guess I can only go with Sybase ASE OLE DB Provider or Adaptive Server Enterprise ODBC driver, if I am going to use SqlConnection con = new SqlConnection ("Connection String"), then which one should I use? Or it does not matter?

谢谢。

编辑:如何知道我的工作场所计算机/数据库是否附带OLE DB提供程序?对于ODBC,我可以在控制面板>下找到数据库。 ODBC数据源管理员



第二编辑:如果我尝试OLE DB连接字符串,则返回"不支持的关键字:提供者";如果我尝试ODBC连接字符串,它将返回"关键字不支持:驱动程序"。

How should I know if my workplace computer/database comes with OLE DB providers? For ODBC, I can find the database under Control Panel > ODBC Data Source Administrator

2nd If I try OLE DB connection string, then it returns "Keyword not supported: Provider"; if I try ODBC connection string, it returns "Keyword not support: Driver".

推荐答案

SqlConnection类用于连接Microsoft SQL Server数据库引擎。要连接到Sybase ASE,您应该使用OdbcConnection或OleDbConnection类。

SqlConnection class is meant for connection to Microsoft SQL Server database engine. To connect to Sybase ASE you should use either OdbcConnection or OleDbConnection class.

但最好的选择可能是使用为Sybase ASE创建的ADO.NET提供程序。您可以在页面的上半部分看到有关它的信息的链接,您可以使用标题"ASE ADO.NET数据提供程序"进行引用。

But probably the best option is to use ADO.NET provider created for Sybase ASE. You can see link to information about it in the upper part of the page you have references with title "ASE ADO.NET Data Provider".


这篇关于如果我使用SqlConnection,我应该使用哪个连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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