.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 27th, 2012, 05:17 AM
qureshi763 qureshi763 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 4 qureshi763 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 50 sec
Reputation Power: 0
Thumbs down how to retrieve Questions table from my database

i have created 2 tables with the name of Questions and Answers
Questions Fields
Q-No
Question
Answer1
answer2
answer3
Answer4
and Answers Dields
Q_no
Correct_answer
-------------------
now my question is how to retrieve Questions table from my database plz tell me the Query
i want to dispay Q-no and Question in textbox and answers in radion boxes please how to?? can u tell me the query
thanks dear

thanks

Reply With Quote
  #2  
Old July 27th, 2012, 05:22 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by qureshi763
now my question is how to retrieve Questions table from my database plz tell me the Query
thanks
SELECT * FROM questions

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #3  
Old July 27th, 2012, 10:03 AM
qureshi763 qureshi763 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 4 qureshi763 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 50 sec
Reputation Power: 0
Exclamation

i have created 2 tables with the name of Questions and Answers
Questions Fields
Q-No
Question
Answer1
answer2
answer3
Answer4
----------------------------
Dear i want to dispay Q-no and Question in textbox and answers in radion boxes please how to?? can u tell me the query
thanks dear

Reply With Quote
  #4  
Old July 27th, 2012, 10:04 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by qureshi763
Dear i want to dispay Q-no and Question in textbox and answers in radion boxes please how to?? can u tell me the query
thanks dear
which application language are you using? php?

Reply With Quote
  #5  
Old July 27th, 2012, 10:21 AM
qureshi763 qureshi763 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 4 qureshi763 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 50 sec
Reputation Power: 0
Thumbs down

dear i am using asp.net and in visual studion 2008
thanks

Reply With Quote
  #6  
Old July 27th, 2012, 10:29 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Dev Shed God 43rd Plane (26000 - 26499 posts)
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,442 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 14 h 15 m 59 sec
Reputation Power: 4141
Quote:
Originally Posted by qureshi763
dear i am using asp.net and in visual studion 2008
thanks
okay, i've moved your thread to the .net forum

may i give you some friendly advice? stop calling people "dear" -- that's not appropriate

Reply With Quote
  #7  
Old July 27th, 2012, 10:33 AM
qureshi763 qureshi763 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2012
Posts: 4 qureshi763 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 50 sec
Reputation Power: 0
ok

Reply With Quote
  #8  
Old September 24th, 2012, 06:36 AM
diyaots diyaots is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2011
Posts: 125 diyaots Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 Day 1 h 59 m 59 sec
Warnings Level: 5
Reputation Power: 0
Query for get data from table:

Hi
Please find the answer.

Query for get data from table:
Select q.Q-No, q.Question, q.Answers1, q.Answers2, q.Answers3, q.Answers4, a.correctanswer from Questions q inner join Answers a on q.Q-no=a.Q-no

There can be two approaches further using dataset or datatable and class object or class type list (Incase we need to fetch multiple questions)

Result set of the query can be saved in class object which contains all the above fields as properties by using datareader.
Let’s assume we are using class Quize which contains below properties
Q-No
Question
Answers1
Answers2
Answers3
Answers4
correctanswer

At front end :
Lets assume obj is Quize class type object containing the values fetch from the database

Qnotxt.text= obj.Q-No.ToString();
Qtext.text= obj. Question.ToString();
Rdb1.text = obj. Answers1.ToString();
Rdb1.text = obj. Answers2.ToString();
Rdb1.text = obj. Answers3.ToString();
Rdb1.text = obj. Answers4.ToString();

*For multiple questions we could have used list of Quize type List<Quize>

Thanks
Diya

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > how to retrieve Questions table from my database

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap