473,811 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Poll

2 New Member
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 2882
kenobewan
4,871 Recognized Expert Specialist
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
bjkc1986
2 New Member
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 Recognized Expert Specialist
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
3261
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 have to be clicked to call the current results individually and replace them with a single link that will be used to call the results of both pages and display them at the same time, most likely in a table. Can PHP be used to do this? How would...
17
1995
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 foo(): (82) 14% C1. def foo() : (235) 41% E1. def foo(): @classmethod (260) 45% Total Votes: 577
28
2403
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 or group of choices: Any J 81 J2 78 Any C 40 C1 29 Any D 9
9
4179
by: Lad | last post by:
Is there a poll script available in Python?
1
2583
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 see what happens, and socket.poll seems to behave very strangely. I've tried to use the .poll method for the poll object with and without a timeout, but in either case, the output randomly switches between on of the versions below. It runs fast,...
0
2046
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 { m_Socket.Connect(ipEndPoint); }
5
2686
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(); The problem I am having with this is that the above function gets called ***after*** the long-running response is completed.
1
6138
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 multiplexing. I wrote a small program to try to get it to work, but I'm having difficulty. I connect to a bunch of non-blocking sockets, then poll them for activity. On POLLOUT, I send an HTTP request. On POLLIN, I recv incoming data. But the loop...
2
2504
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 issue. There are 2 methods: 1. Storing options in ANSWERS table and executing 2 queries to get poll's data and options. Number of records connected with a poll in that table is equal to number of poll's options.
4
17549
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
9730
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10392
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10403
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6893
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5693
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4341
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.