string sql = string.Format("insert into Student (name,address,tele,email,sex,grade,class) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}'),name,adress,tele,email,sex,grade,class14");
哪里错了?
------解决方案--------------------------------------------------------
string sql = string.Format("insert into Student (name,address,tele,email,sex,grade,class) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')“,name,adress,tele,email,sex,grade,class14);
最后“放错位置了
------解决方案--------------------------------------------------------
string sql = string.Format("insert into Student (name,address,tele,email,sex,grade,class) values({0},{1},{2},{3},{4},{5},{6})","name","adress","tele","email","sex","grade","class14");
------解决方案--------------------------------------------------------
string sql = string.Format("insert into Student (name,address,tele,email,sex,grade,class) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",name,adress,tele,email,sex,grade,class14);
------解决方案--------------------------------------------------------
string sql = string.Format("insert into Student (name,address,tele,email,sex,grade,class) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",name,adress,tele,email,sex,grade,class14);