Solved

how do i get the values from a table

Posted on 2006-11-03
1
186 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Authentication of Web Services 3 53
Need to pass a connection through class/Method 1 39
Exit the loop 4 37
Video Player 2017 5 14
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…
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…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

896 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now