cmd.CommandText = "Insert into nr(内容)values('aaaa')"里面如何将'aaaa'改成一个文本框里面的值
展开全部
public int TeacherAdd(string paramJobNumber)
{
int returnValue = 0;
SqlConnection mySqlConnection = new SqlConnection(Conn);
mySqlConnection.Open();
string sqlText =@"INSERT INTO [nr(内容) ([TeacherID]
VALUES ('" + paramJobNumber + "')";
SqlCommand mySqlCommand = new SqlCommand(sqlText, mySqlConnection);
returnValue = mySqlCommand.ExecuteNonQuery();
mySqlConnection.Close();
return returnValue;
}
用参数
{
int returnValue = 0;
SqlConnection mySqlConnection = new SqlConnection(Conn);
mySqlConnection.Open();
string sqlText =@"INSERT INTO [nr(内容) ([TeacherID]
VALUES ('" + paramJobNumber + "')";
SqlCommand mySqlCommand = new SqlCommand(sqlText, mySqlConnection);
returnValue = mySqlCommand.ExecuteNonQuery();
mySqlConnection.Close();
return returnValue;
}
用参数
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询