public partial class vote : System.Web.UI.Page
{
private string voteId = "1";
protected void Page_Load(object sender, EventArgs e)
{
SqlConnection con = DB.creatConnection();
con.Open();
SqlCommand cmd = new SqlCommand("select voteTitle from voteMaster where voteId"+ this.voteId, con);
string title = Convert.ToString(cmd.ExecuteScalar());
this.lab1.Text = title;
}
}
用户代码未处理 System.Data.SqlClient.SqlException
Message="第 1 行: 'voteId1' 附近有语法错误。"