C#连接字符串语法错误? [英] C# Connection String syntax error?

查看:79
本文介绍了C#连接字符串语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何正确编写?我认为这是Excel 2013。


谢谢。


解决方案

我不知道连接字符串,但我认为您的问题是您需要在内部引号前加上反斜杠,或者在整个字符串前加上"@"符号并使用引号对。

 string s1 ="带有\"Quotes \"的字符串在里面。"; 
string s2 = @"另一个带有"" quotes"""的字符串在里面。";





How to write it correctly? I think it is Excel 2013.

Thanks.

解决方案

I don't know about connection strings, but I think your problem is that you need to either prefix the internal quote marks with backslashes, or prefix the whole string with an '@' sign and use pairs of quotes.

         string s1 = "A string with \"Quotes\" inside it.";
         string s2 = @"Another string with ""quotes"" inside it.";



这篇关于C#连接字符串语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆