【问题标题】:What is a Correct Connection String for SQL Server? [closed]SQL Server 的正确连接字符串是什么? [关闭]
【发布时间】:2013-10-13 22:43:12
【问题描述】:

什么是 SQL Server 的正确连接字符串?我使用的 ODBC 连接字符串不起作用。如何找出问题所在?

这是我正在处理的整个项目的一小部分,但它不起作用。

public static class Extensions
{
    public static string constr = "Driver={SQL Server};server=127.0.0.1;uid=test;pwd=test123;database=account";
    //public static string constr = "Driver={SQL Server};server=127.0.0.1;uid=test;pwd=test123;app=Microsoft® Visual Studio® 2010;wsid=WIN-8VW8RV959F2;database=account";
    public static byte[] StrToByteArray(string str)
    {

【问题讨论】:

标签: c# sql sql-server


【解决方案1】:

你的连接字符串可以改写为:

data source=127.0.0.1;initial catalog=account; user id=test;password=test123

其他变体可以在http://www.connectionstrings.com/上找到

【讨论】:

    【解决方案2】:
    public static class Extensions
    {
        public static string constr = "Data Source=ServeName;Initial Catalog=Database_Name";
        //public static string constr = "Data Source=ServeName;Initial Catalog=Database_Name";
        public static byte[] StrToByteArray(string str)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-13
      • 2012-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-28
      • 2023-03-23
      相关资源
      最近更新 更多