Click here to Skip to main content
15,902,636 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I selected a row from DB.

the data look like this

-------------------
productid |  Qty
-------------------
  123     |   12



I put this in ViewData.

ViewData["viewtest"] = selected data from above. (productid:123, qty:12)


on the View, I like to get only the qty value from the viewdata.
what kind of syntax should I use for that?

I keep thinking about datatable or dataset from asp.net..
So I tried ViewData["viewtest"][0]["qty"]... and so on which never works..

I have to bring the two values (productid and qty) at the same time and split the value from the view..

can anybody help???

thank you in advance.
Posted
Updated 28-Mar-11 9:04am
v2

1 solution

Why don't you try as -

ViewData["ProductId"] = //select data for product id
ViewData["Quantity"] = //select data for quantity






HTH
Rajeev

Please vote and mark the answer as accepted if this helps you.

 
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