Help me_格式化字符串问题_AX
①string str=String.Format("INSERT INTO AD_CARVEOUT VALUES ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}')",this.UserName,this.Name,this.Sex,this.Age,this.Tel,this.Email,this.Area,this.Money,this.Trade,this.ProjectSummary);
②string str="INSERT INTO AD_CARVEOUT VALUES ('"+this.UserName+"','"+this.Name+"','"+this.Sex+"','"+this.Age+"','"+this.Tel+"','"+this.Email+"','"+this.Area+"','"+this.Money+"','"+this.Trade+"','"+this.ProjectSummary+"')";
为什么①不行,②可以?
②string str="INSERT INTO AD_CARVEOUT VALUES ('"+this.UserName+"','"+this.Name+"','"+this.Sex+"','"+this.Age+"','"+this.Tel+"','"+this.Email+"','"+this.Area+"','"+this.Money+"','"+this.Trade+"','"+this.ProjectSummary+"')";
为什么①不行,②可以?
少帮主的斧头好久不饮血了!