Black Diamond

Black Diamond

  • NA
  • 236
  • 108.9k

How to fix update error?

Sep 5 2011 11:30 AM
Hi everyone,

I hava a code to update sql table, but when i look at the table nothings happen its empty this is my code:

Vote = count.ToString();
conn.Open();
CountUpdate.Parameters.Add(SqlCommand CountUpdate = new SqlCommand("UPDATE FinalVotes SET Name='"+btnCandidates1.Text+"' where Votes='"+Vote+"'", conn);
CountUpdate.Parameters.Add("@Name", SqlDbType.VarChar,100).Value=DBNull.Value;"@Votes", SqlDbType.VarChar,100).Value =DBNull .Value;


CountUpdate.ExecuteNonQuery();


conn.Close();


please help me out this problem...thanks





Answers (5)