连接字符串出错 [英] Error in connection string
本文介绍了连接字符串出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到以下错误.plz帮助
初始化字符串的格式不符合规范
conn = new SqlConnection(Server = xxx-yyy \ awpp; Initial Catalog = CHIM; Trusted_Connection = True);
conn.Open( );
I am getting the following error.plz help
Format of the initialization string does not conform to specification
conn = new SqlConnection("Server=xxx-yyy\awpp;Initial Catalog=CHIM;Trusted_Connection=True");
conn.Open();
推荐答案
尝试
Try
conn = new SqlConnection("Data Source=xxx-yyy\awpp;Initial Catalog=CHIM;Integrated Security=True");
conn.Open();
conn = new SqlConnection(@Server = xx-yy \ awpp; Initial Catalog = CHIM; Trusted_Connection = True); < br $> b $ b
或
conn = new SqlConnection(Server = xx- yy\\awpp;初始目录= CHIM; Trusted_Connection = True);
帮助。
conn = new SqlConnection(@"Server=xx-yy\awpp;Initial Catalog=CHIM;Trusted_Connection=True");
OR
conn = new SqlConnection("Server=xx-yy\\awpp;Initial Catalog=CHIM;Trusted_Connection=True");
helps.
请放入web.config或app.confg文件中的连接字符串,否则请尝试以下操作:
conn = new SqlConnection(@ Server = xxx-yyy \ awpp;初始目录= CHIM; Trusted_Connection = True);
conn.Open();
Please put the connection string in the web.config or app.confg file otherwise try the following:
conn = new SqlConnection("@Server=xxx-yyy\awpp;Initial Catalog=CHIM;Trusted_Connection=True");
conn.Open();
这篇关于连接字符串出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文