Click here to Skip to main content
15,042,397 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a category table with 4 columns as and i have made Id as identity as well as Primarykey

ID Categoryname Cimage

Then i have a subcategory table as

ID1 Subcategoryname Simage Description Catid .

In category page

I have a Textbox (for entering name of category) and Image . I have binded it to gridview.
so my gridview displays Textbox data and image.

In my Subcategory page

I have a dropdownlist ,Textbox1 (for entering name of subcategory) , Image , Textbox2 (for entering description)

I populate the dropdownlist from category table(categoryname)
and the rest data should be saved into database and display in gridview..

I am stuck with subcategory page .My data enters into database but unable to display in gridview....

how should i relate 2 tables with id and catid .
and how to write the connections for subcategory page..

I have been trying for weeks but dint succeed...

can anyone help me out with detailed coding. please

Thanks in advance .

1 solution

Make the Category id in the SubCategory Table as foreign key and relate it to ID in the Main category table. But still I didnt get you post your problem clearly with sample code

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