gpt4 book ai didi

c# - 初始化字符串的格式不符合从索引 50 开始的规范

转载 作者:太空宇宙 更新时间:2023-11-03 17:09:40 26 4
gpt4 key购买 nike

我不知道这是什么意思,请问我能得到一些帮助吗

"Format of the initialization string does not conform to specification starting at index 50."

代码:

InitializeComponent();
connString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=C:\\Users\andrew\\Documents\\Vinyl0.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True";
query = "SELECT * FROM Record";
dAdapter = new SqlDataAdapter(query, connString); //This is where the error appears.
dTable = new DataTable();
cBuilder = new SqlCommandBuilder(dAdapter);
cBuilder.QuotePrefix = "[";
cBuilder.QuoteSuffix = "]";
myDataView = dTable.DefaultView;
dAdapter.Fill(dTable);
BindingSource bndSource = new BindingSource();
bndSource.DataSource = dTable;

最佳答案

我注意到 C:\\Users\andrew\\

看起来你在中间寻找一个 \\ 但最终以 \a 结束,这是一个破坏格式的字符的转义序列你的连接字符串。

关于c# - 初始化字符串的格式不符合从索引 50 开始的规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16342394/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com