473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

C# Poll

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:

Expand|Select|Wrap|Line Numbers
  1. create table pollQuestions 
  2.  
  3.  
  4. pk_Id int auto_increment not null, 
  5.  
  6. question varchar(100) not null, 
  7.  
  8. answer1 varchar(50) not null, 
  9.  
  10. answer2 varchar(50) not null, 
  11.  
  12. answer3 varchar(50) not null, 
  13.  
  14. answer4 varchar(50) not null, 
  15.  
  16. answer5 varchar(50) not null, 
  17.  
  18. primary key(pk_Id), 
  19.  
  20. unique id(pk_Id) 
  21.  
  22. );
  23.  
  24.  
  25. create table pollAnswers 
  26.  
  27.  
  28. pk_Id int auto_increment not null, 
  29.  
  30. pollId int not null, 
  31.  
  32. answer varchar(50) not null, 
  33.  
  34. visitorIP varchar(15) not null, 
  35.  
  36. primary key(pk_Id), 
  37.  
  38. unique Id(pk_Id) 
  39.  
  40. );

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
Feb 27 '07 #1
3 2865
kenobewan
4,871 Expert 4TB
Please specify the error problem that you are having saving to poll answers. What do you plan to use to draw the graph? Does using an IP identifier label corporate users as potentially one user? Maybe using a session or cookie to identify users would be better.
Feb 27 '07 #2
Please specify the error problem that you are having saving to poll answers. What do you plan to use to draw the graph? Does using an IP identifier label corporate users as potentially one user? Maybe using a session or cookie to identify users would be better.
I'm very new to this whole area of programming and db's and all that so i was wondering how do i store the selected 1 of the 5 answers into the answer table and increment it so that every time the answer is selected, its incremented. I was hoping to build just a basic bar graph showing the results to date but am unsure how this could be achieved in visual studio 2005
Feb 27 '07 #3
kenobewan
4,871 Expert 4TB
Do you have Crystal Reports installed? Here is an article that may help:
Creating Professional Reports using Crystal Report for Visual Studio.NET (Part 1)
Feb 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: JDJones | last post by:
I'd like to put up two polls on my web site on a single page. I will be using a free remotely hosted poll service. That part is easy. But I want to remove the two individual <a href> links that...
17
by: Doug Holton | last post by:
George W Bush, as certified by Florida's election commission. Which decorator syntax do you like the most? See http://wiki.wxpython.org/index.cgi/PythonDecoratorsPoll A. @classmethod def...
28
by: Paul McGuire | last post by:
Well, after 3 days of open polling, the number of additional votes have dropped off pretty dramatically. Here are the results so far: Total voters: 55 (with 3 votes each) Votes for each choice...
9
by: Lad | last post by:
Is there a poll script available in Python?
1
by: Magnus Lycka | last post by:
I'm trying to read standard out in a process started with popen2 in a non-blocking way. (Other good ways of doing this than the one I tried are appreciated.) I've tried to dumb down my code to...
0
by: jinfeng_Wang | last post by:
I have writen the following souce code : m_Socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); m_Socket.Blocking = false; try {...
5
by: pbd22 | last post by:
Hi. I am trying to poll a long-running process via a hidden IFrame. I am noticing that the online errata gives advice for handling a server response: window.parent.handleServerResponse(); ...
1
by: chsalvia | last post by:
I'm trying to implement a simple poll loop which asynchronously fetches a list of URLs. Since I'm used to working with multiple threads, I have little experience using single-threaded IO...
2
by: webcm123 | last post by:
I'm making some changes in poll module. I don't know which method of storing options of poll is better. The main data of polls are in POLLS table. Speed and efficiency is the most important...
4
by: 7stud | last post by:
Hi, What is the difference between: 1) getting the returncode directly from the subprocess object 2) calling poll() on the subprocess object? Here is an example:
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.