我想将dropdownlist
和我的textbox
值插入到我的数据库存储过程中,但它不会插入,也不会给我任何错误。我有什么想法吗?
protected void btnPlaceScores_Click(object sender, EventArgs e)
{
string conn = WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString;
using (SqlConnection myconnection = new SqlConnection(conn))
{
SqlCommand cmd = new SqlCommand("MatchScores", myconnection);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("HomeTeam", drop1.SelectedItem.Value);
cmd.Parameters.AddWithValue("AwayTeam", drop2.SelectedItem.Value);
cmd.Parameters.AddWithValue("Scores", txtScores.Text);
try
{
myconnection.Open();
cmd.ExecuteNonQuery();
}
catch { }
finally
{
myconnection.Close();
}
}
}
答案 0 :(得分:0)
不确定您是否使用Microsoft SQL,通常参数以' @'
开头void printInOrder(nodo * raiz) {
if (raiz != NULL) {
printInOrder(raiz->esq);
printf("%s\n", raiz->codigo);
printInOrder(raiz->dir);
}
}