【问题标题】:connection string in with a local db c# windows forms与本地数据库 c# windows 窗体中的连接字符串
【发布时间】:2017-01-08 00:26:43
【问题描述】:

我使用 Visual Studio 2015 创建了一个数据库,方法是在本地将其添加为 mdf 文件

按照本指南:Walkthrough creating a local database SQL Server Express

抛出的异常是Format of the initialization string does not conform to specification starting at index 81.

我正在构建一个 Windows 窗体应用程序。

我的连接字符串看起来像这样string cs = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\TestDb.mdf;Integrated";

【问题讨论】:

    标签: c# winforms database-connection


    【解决方案1】:

    您可以使用 Visual Studio 的服务器资源管理器连接到您的数据库,然后您将获得正确的连接字符串:

    http://www.c-sharpcorner.com/uploadfile/suthish_nair/how-to-generate-or-find-connection-string-from-visual-studio/

    【讨论】:

    • 伙计,你让我的生活变得轻松多了!!我不知道VS中的那个细节非常感谢你!!!
    • 很高兴我能帮上忙。祝你好运。
    猜你喜欢
    • 1970-01-01
    • 2014-05-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多