title: Retrieve data from dataset
body: <pre><code>SqlDataAdapter da = new SqlDataAdapter("Select StudentID,StudentName from StudentMaster where StudentID = '" + start + "'", conn);              
  DataSet ds = new DataSet();
  da.Fill(ds,"StudentMaster");
  SqlDataAdapter db = new SqlDataAdapter("Select Registration_No from Candidate_Registration where StudentID='" + start + "'", conn);
  db.Fill(ds, "Candidate_Registration");
  </code></pre>
  
  <p>Here 'start' is a textbox value of a textbox in previous form i.e form2. 
  I want to fetch StudentName and StudentID from StudentMaster where StudentID = start.
  The table is named 'StudentMaster'.
  Fill the dataset with StudentMaster.
  Then I want to fetch Registration_No from Candidate_Registration where StudentID=start.
  The table is named 'Candidate_Registration'.
  Fill the dataset with Candidate_Registration.
  Now according to the 'Registration_No' that is fetched, I want to fetch 'CourseID' from 'Registered_Courses'.
  But, the problem is, how to access the fetched 'Registration_No' i.e. how to put it in the following query:
  if I can take the fetched Registration_No into a variable named 'reg_no' then,
  "Select CourseID from Registered_Courses where Registration_No="+ reg_no;</p>
  
  <p>For more understanding I mention the tables and the relationships....</p>
  
  <pre><code>StudentMaster
  -------------
  StudentID Primary key,
  StudentName
  
  Candidate_Registration
  ----------------------
  Registration_No Foreign key,
  ExamID Foreign key,
  StudentID Foreign key,
  Seat_No,
  Primary key(Registration_No,ExamID)
  
  Registered_Courses
  ------------------
  Registration_No Primary key,
  ExamID Foreign key,
  CourseID Foreign key,
  
  Course_Master
  -------------
  CourseID Primary key,
  Course_Name,
  Description
  </code></pre>
  
  <p>i.e. finally I want to get the Course_Name for a particular StudentID.</p>
  
  <p>Can anyone please help me out. Thanks in advance!</p>