Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

how do i get the values from a table

Posted on 2006-11-03
1
Medium Priority
?
194 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 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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