string sql = String.Format("update Student set StudentId='{0}',StudentName='{1}', StudentNO='{2}', Sex='{3}', StudentIDNO='{4}',Major='{5}',Phone='{6}',Address='{7}',PostalCode='{8}'where StudentId='{9}';",把套红的干掉。也就是说ID那一列不能往回写
调试欢乐多
insert into table (列1,列2,列3) values (值1,值2,值3)
而不要使用insert into table values(...,...,...)
这样在insert的时候不要指定插入自动增长的列