Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can anyone know this?

let consider we have two forms such as addproduct and its gridview....

but in this addproduct w have one attribute called categoryname that is get from

before on etable called category by using drop down list....but in this grid view

instead of catagoryname it should pass its id?

what is the .net coding for that?
Posted

Hello

Use session or Query string for this


Thanks,
 
Share this answer
 
Request.QueryString["variable"]=value;
Session["variable"]=value;
 
Share this answer
 
v2
Ya that's should be Happend bcz at the time of Add Product You store Category ID into the Product Table.

so for the solution you have to write a Query in such way so it will display category name instead of it' id. for eg.

your category table like this...
1. categoryId
2. CategoryName

and your product table like this...
1. ProductId
2. ProductName
3. CategoryID

now your Query to display Category Name is like this...

Select ProductName,CategoryName From Products inner join Category on
Products.CategoryID=Category.CategoryID

I think this will help you to solve your problem.
 
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