Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3314874
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:17:02+00:00 2026-05-17T22:17:02+00:00

hai guys, i am planning to create a table view and the detail view

  • 0

hai guys,
i am planning to create a table view and the detail view for the corresponding row, all the datas are fetch from the sqlite database. For this i have created two tables in the database table one for the datas in the table view list and table two for the detail view of the table list. i set the product id as the primary key for the table one. i want the product id as the foreign key for table two. i don’t know how to set the foreign key for it and don’t know how to retrieve from the table two and display it in the detail view. please help me to do this.
Thanks in advance…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:17:03+00:00Added an answer on May 17, 2026 at 10:17 pm
     1.Change your DB Settings enable to Foreign Keys.
    
     2.Create the child table like this
    
    
       table1 is the parent table having id1 as primary key.
    
         CREATE TABLE "table1" ("id1" INTEGER PRIMARY KEY  AUTOINCREMENT  NOT NULL)
    
       table2 is the child table having id2 as a foreign key with reference to  id1 of table1.
    
    CREATE TABLE table2 ( 
          id2           INTEGER, 
          parent_id    INTEGER, 
          description  TEXT,
          FOREIGN KEY (id2) REFERENCES table1(id1)
     )
    

    Use equijoin to retrieve the data from the tables.

     select * from table1,table2 where table1.id1=table2.id2;
    
     or
    
     select table2.* from table2,table1 where table1.id1=table2.id2; 
    
      to retrieve the data from single table alone.
    

    Hope this helps to you!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hai guys, I want to send scheduled mail every morning from my application and
hai guys, I have imported my gmail contacts from gmail and a file name
Hai guys, how to connect to a sql server database in asp.net mvc ...
Hai all, I want to know how to disable row header in Devexpress xtragrid
Hai guys, I have a table with a column named Is_Deleted and my query
Hai All i want to create an XML file with following format <myFiles> <name>myname</name>
Hai Guys, My application deals scheduled mail concept (i.e) every morning 6.00 am my
Hai Guys, How to get wan ip address of my user using php....
Hai guys, How to include inline jquery scripts used in an aspx to a
hai guys, I want to upload images through my web page to a folder

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.