Thanks for all.
But my problem is a little different.
Example:
The system SELECT COUNT the table "QUESTIONS" on DB
commCountQuestions = new SqlCommand("SELECT COUNT(*) AS total FROM
Questions", conn);
Then,
int t = readerPerguntas.GetOrdinal("total");
Then I do a SELECT to Select the Questions in table Questions and Select the
ANSWERS in the table ANSWERS.
for (i=1, i<16, i++)
{
sqlcommQUESTION = "SELECT * FROM Questions WHERE id=" + i + "";
sqlcomm = "SELECT * FROM Answers WHERE id =" + i + "";
}
The problem is: I can't do two readers READ at the same time. I don't know
how to do a JOIN that works.
INFO: One Question have 2 questions or more...
The results should be:
1. What's the color of the sea?
[checkbox] Blue
[checkbox] Red
[checkbox] Yellow
[checkbox] Green
2. Do you like cookies?
[checkbox] Yes
[checkbox] No
3. ... ... ..
[checkbox] ...
I don't know how to solve this problem!!!!
Sorry my english...
Grillo
<Ji*******@gmail.comwrote in message
news:11**********************@v23g2000prn.googlegr oups.com...
declare @someId int
set @someId = 1
select * from categories
where categoryid = @someId
hope it can help :)
Guilherme Grillo wrote:
>Hi...
I need to create a SELECT with a variable in WHERE...
Example:
SELECT * FROM ANSWERS WHERE id = 1
>>then return the results and execute
SELECT * FROM ANSWERS WHERE id = 2
... ... ...
It's possible?
Thanks and sorry my english.
Grillo