Click here to Skip to main content
15,883,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have 2 tables:
• Table 1: SubID, SubName, SubDescription, SubStatus
• Table 2: ProID, ProName, SubID, ProContent, ProDate, ProStatus
I would like to display the Table 2 with the SubName in the table and update the ProContent and Prostatus. The ProStatus has a value of True and False.
How can I display the table and perform the update and delete queries?
Posted
Comments
DamithSL 2-Oct-15 0:04am    
what have you tried so far?

select a.SubID, a.SubName, a.SubDescription,a.SubStatus,b.ProID,b.ProName, b.SubID, b.ProContent, b.ProDate, b.ProStatus from table1 as a inner join table2 as b on a.SubID=b.SubId..


Show above result inyour GridView...

Edit,Delete By Means SUBID
 
Share this answer
 
Well, Let's go step by step:

1. Write a SQL JOIN[^] Query to get the desired data from more than one tables.
2. Use SQLCommand, DataAdapter, DataSet/DataTable to get the records from DB. Refer this: https://www.youtube.com/watch?v=1EpYqtSlOr8[^]
3. Bind the DataTable/DataSet to your Gridview. You can find more information about that here: http://www.aspdotnet-suresh.com/search/label/Gridview[^]
4. Then, you can perform your CRUD operation on GridView. http://www.aspsnippets.com/Articles/GridView-CRUD-Select-Insert-Edit-Update-Delete-using-Single-Stored-Procedure-in-ASPNet.aspx[^]

-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900