Solved

how do i get the values from a table

Posted on 2006-11-03
1
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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