Solved

how do i get the values from a table

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

12 Experts available now in Live!

Get 1:1 Help Now