http://bbs.csdn.net/topics/390639485?page=1
string
strfac=
"insert into CarInfo values('"
+TextBox1.Text.ToString()+
"','"
+TextBox2.Text.ToString()+
"','"
+TextBox3.Text.ToString()+
"','"
+TextBox4.Text.ToString()+
"','"
+TextBox5.Text.ToString()+
"')"
;
在字符串外面换行,或者
string s = @"1
2";
加了@可以在内部换行,以上代码等价
string s = "1 2";
或者
string s = "1 " +
"2";
string s = @"1
2";
加了@可以在内部换行,以上代码等价
string s = "1 2";
或者
string s = "1 " +
"2";
string
strfac=
"insert into CarInfo values('"
+TextBox1.Text.ToString()+
"','"
+TextBox2.Text.ToString()+
"','"
+TextBox3.Text.ToString()+
"','"
+TextBox4.Text.ToString()+
"','"
+TextBox5.Text.ToString()+
"')"
;
string strfac=string.Format(@"insert into CarInfo
values('{0}','{1}','{2}','{3}','{4}')",
TextBox1.Text.ToString(),
TextBox2.Text.ToString(),
TextBox3.Text.ToString(),
TextBox4.Text.ToString(),
TextBox5.Text.ToString());