You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
611 B

using System;
using System.Data.OleDb;
public class cs_Vote : OboutInc.oboutAJAXPage
{
public string onVote(int qNr, int aNr, int nrOfAnswers)
{
string result = qNr.ToString();
int [] q = new int [nrOfAnswers + 1];
// connect to the database
OleDbConnection myConn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("../App_Data/vote.mdb") + ";User Id=Admin;Password=;");
OleDbCommand myComm;
myConn.Open();
// add 1 vote to the answer chosen
myComm = new OleDbCommand("UPDATE VoteOption set Result=Result+1 where QID=" + qNr + " and AID=" + aNr, myConn);