SqlConnection mySqlConnection=new SqlConnection("server=MASTER;database=shiyan;uid=sa;pwd=");
mySqlConnection.Open();
string insertString = "INSERT INTO Customer (" + " stu_name,stu_sex,stu_age,stu_class" + ") VALUE ( " +
" @stu_name,@stu_sex,@stu_age,@stu_class" + ")";
SqlCommand mySqlCommand=mySqlConnection.CreateCommand();
mySqlCommand.CommandText=insertString;
mySqlCommand.Parameters.Add("@stu_name",SqlDbType.Char,10);
mySqlCommand.Parameters.Add("@stu_sex",SqlDbType.Char,10);
mySqlCommand.Parameters.Add("@stu_age", SqlDbType.Char,10);
mySqlCommand.Parameters.Add("@stu_class",SqlDbType.Char,10);
mySqlCommand.ExecuteNonQuery();
行 34:
行 35: mySqlCommand.Parameters.Add("@stu_class",SqlDbType.Char,10);
行 36: mySqlCommand.ExecuteNonQuery();
行 37: }
行 38:
源文件: c:\inetpub\wwwroot\8888888\webform1.aspx.cs 行: 36
堆栈跟踪:
|