转载自:https://www.cnblogs.com/zhjason/p/14046337.html
前面先单引,再双引;变量放中间,+号放左右;后面与前面配对,先双引,再单引。
如下:
' "+变量+" '
例:
写法1:
string sql = " select * from t_admin where Uid='"+textBox_username+"' and pwd='"+textBox_userpwd+"' ";
写法2:
string sql = $" select * from t_admin where Uid='{textBox_username}' and pwd='{textBox_userpwd}' ";