string sqlString =$"insert into Students(StudentName,Gender,Birthday,AttendanceNO,Stulmage,Age,Phone,StudentAddress)VALUES('{students.StudentName}','{students.Gender}','{students.Birthday}','{students.AttendanceNO}','{students.Stulmage}',{students.Age},'{students.Phone}','{students.StudentAddress}')";
uj5u.com熱心網友回復:
string sqlString =$"insert into Students(StudentName,Gender,Birthday,AttendanceNO,Stulmage,Age,Phone,StudentAddress)VALUES('{0}','{1}','{2}','{students.AttendanceNO}','{3}',{4},'{5}','{6}'",students.Birthday,students.AttendanceNO,students.Stulmage,students.Age,students.Phone,students.StudentAddress)";
uj5u.com熱心網友回復:
漏了一點$ 改成 string.Format(
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/272405.html
標籤:C#
