不支持关键字。参数名称:综合安全
大家好,当我尝试从 App.config
文件检索连接时,我收到指定的错误。
我的 App.Config
如下
<add name="Conn"
connectionString="Data Source=SYSTEM19\SQLEXPRESS;Initial Catalog=Dora;Integrated Security=True"
providerName="System.Data.SqlClient" />`
在这行代码中我收到提到的错误任何人都可以帮助我
dataAdapter = new MySqlDataAdapter(selectCommand, MyConnectionString);
Hi all I am getting the error as specified when I am trying to retrieve the connection from App.config
file.
My App.Config
is as follows
<add name="Conn"
connectionString="Data Source=SYSTEM19\SQLEXPRESS;Initial Catalog=Dora;Integrated Security=True"
providerName="System.Data.SqlClient" />`
At this line of code I am getting the error mentioned can any one help me
dataAdapter = new MySqlDataAdapter(selectCommand, MyConnectionString);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
MySQL 连接字符串
集成安全性对于 MySQL 连接字符串来说不是有效的关键字
MySQL Connection String
Integrated Security is not valid keyword for MySQL connection strings
我遇到这个问题是因为我缺少
Initial Catalog=
位!I had this issue because I was missing the
Initial Catalog=
bit!我遇到这个问题是因为“安全”一词位于下一行!
I had this issue because the word Security was on the next line!
就我而言,在我从另一个项目复制并粘贴连接字符串后,Visual Studio 2022 会自动在
Integrated
和Security
之间添加逗号。删除逗号后,一切正常。In my case, Visual Studio 2022 automatically added a comma between
Integrated
andSecurity
after I copied and pasted the connection string from another project. After I removed the comma, everything is working fine.