.net投票的一点小问题!!!~

来源:百度知道 编辑:UC知道 时间:2024/05/12 15:16:44
我的代码是这样的,在倒数第2行出现错误提示:至少一个参数没有被指定值....那是哪错了呢?应该怎么改呢??
string m_sConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + System.Web.HttpContext.Current.Server.MapPath("~/App_Data/data.mdb");
OleDbConnection m_sqlConnection = new OleDbConnection(m_sConnectionString);
m_sqlConnection.Open();

string str = "update infor set VoteNum=VoteNum+1 where UserID=" + this.RadioButtonList1.SelectedValue.ToString();
OleDbCommand m_sqlCommand = new OleDbCommand(str, m_sqlConnection);
m_sqlCommand.ExecuteNonQuery();
m_sqlConnection.Close();

我这个就是一个投票点击就+1的小程序...
是啊,感谢你俩的帮助,我决定也给那个达人一次最佳答案的机会...

数据操作符丢失吧?
string str = "update infor set VoteNum=VoteNum+1 where UserID='" + this.RadioButtonList1.SelectedValue.ToString()+"'";

晕,你UserID是自动编号的话

string str = "update infor set VoteNum=VoteNum+1 where UserID=" + Convert.ToInt32(RadioButtonList1.SelectedValue.ToString())+'";

你怎么还问?
不是已经解决了吗?