使用WPF应用程序选择选项时登录时出现错误[关闭]

问题描述 投票:-3回答:1

我在登录页面后运行我的应用程序时收到此错误,当我选择出现错误的任何选项时,有四个选项可供选择。enter image description here

c# wpf system.data.sqlite
1个回答
-1
投票

您使用的连接字符串是什么?

有效连接字符串的示例:

_cnn = new SqlConnection(
                                new SqlConnectionStringBuilder()
                                {
                                    DataSource = @"YourServerAdress",
                                    InitialCatalog = "YourDB",
                                    UserID = "username",
                                    Password = "password"
                                }.ConnectionString
                            );

编辑,对于sqlliteconnection,连接字符串为:

_cnn = new SQLiteConnection("Data Source =" + PathOfYourdbFile + "; Version=3;");

_cnn.Open();
© www.soinside.com 2019 - 2024. All rights reserved.