I'm in need of assistance ,currently I'm working an Questionnaire solution project that consists inputting results of a questionnaire(saved in sql database) and then an average of certain questions is given.
I'm having trouble when i need to work the average of the questions
one of my question is there are seven text boxes that cover ages from 0 till 60 that the user has to input in the text boxes
the amount of people that are in a certain group of age.(sort of like below)
0-10 [text box]<--enter amount of people that the user has in the family of that group
11-20 [text box]
21-30 [text box]
31-40 [text box]
41-50 [text box]
the code that i have worked till now is the one below.i think the trouble is where i placed the arrows
Expand|Select|Wrap|Line Numbers
- //Connection string
- SqlConnection MyConnection = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|dbQuestionaireSolution.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True");
- string av1 = "SELECT[0-10]FROM Quest3 WHERE (Region = 'NorthernDistrict')";
- SqlCommand MysqlCommand =new SqlCommand(av1, MyConnection);
- MyConnection.Open();
- SqlDataReader reader = MysqlCommand.ExecuteReader();
- if (reader.Read())
- {
- int ND1 = Int32.Parse(av01); <-------
- // this.textBox1ND.Text = reader["0-10"].ToString();<------
- //int ND1 = int.Parse(textBox1ND.Text);<-----
- for (int i = ND1; i == null; i++)
- {
- int total = ((i + i)/int.MaxValue);
- total = Convert.ToInt32(textBox1ND.Text);
- }