Solved

how do i get the values from a table

Posted on 2006-11-03
1
189 Views
Last Modified: 2010-04-16
I need help with this one because I have no clue on how should I do this. I have a table where I have the scores for all the answers. So, when the client selects the answer, he gets a score and he won't be able to see his scores until he is done with the questions. Lets say, there are 11 questions and once he is done with them, then at the end he will get a total score of based on what he selected. The scores are stored in a table called Scores in the SQL database. How would you assign the score to the client once he is done. Thank you all in advance.
0
Comment
Question by:siddhuoops
1 Comment
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 17871954
try
{
System.Data.SqlClient.SqlConnection AConnection = new System.Data.SqlClient.SqlConnection
                        ("workstation id=GEMT-SD-D025;packet size=4096;user id=gem;data source=GSS-FS;persist security info=True;initial catalog=RANDD;password=gem");
                  AConnection.Open();
                  object obj= new System.Data.SqlClient.SqlCommand
                        ("SELECT score FROM score FOR where client = '"+"ClientId'"+,AConnection).ExecuteScalar();
                  string AStr = obj.ToString();
                  }
catch(Exception ex)
{
MesageBox.Show(ex.Messgae);
}
finally
{
}

AStr would contain the score
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Graphics 2 32
Jquery/JSON passing value from one function to another 12 60
.NET 2008 VB and C# 6 39
Using data from certificate to re-create certificate programmatically 3 26
Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question