Brian

Brian

  • NA
  • 5
  • 0

c# Poll

Feb 25 2007 12:34 PM
Hi Guys,

I'm trying to develop an opinion poll on my website (Visual Studio 2005) using c# code and a MYSql db.I have created the db and the admin side of the project for adding new polls to the db and deleting polls but I dont know how I can re-create them for the main section of the website i.e converting the questions in the db, which are in text form, into radio boxes, and then storing the votes in the db and generating a graphical view.

The Tables I have created are as follows:

create table pollQuestions

(

pk_Id int auto_increment not null,

question varchar(100) not null,

answer1 varchar(50) not null,

answer2 varchar(50) not null,

answer3 varchar(50) not null,

answer4 varchar(50) not null,

answer5 varchar(50) not null,

primary key(pk_Id),

unique id(pk_Id)

);


create table pollAnswers

(

pk_Id int auto_increment not null,

pollId int not null,

answer varchar(50) not null,

visitorIP varchar(15) not null,

primary key(pk_Id),

unique Id(pk_Id)

);


I can Insert and delete values into pollQuestions but am having trouble trying to save these answers into pollAnswers and generating a graph with them. Also is there a way I can save the voters ip address to ensure only 1 vote is cast per person.

Apologies for being long-winded but any help would be fantastic.

Thanks