Hi, I'm new to ASP.NET. I began learning as I had to make a website for a college project using a language I didn't already know (I know PHP pretty well so I'm not a total noob :P).

Basically what I'm trying to do is get a list of products, display them and then display all the comments for each product. So I have a ListView for getting all the products, but I want a DataSource inside the ListView with the search string being something like "SELECT * FROM comments WHERE prod_id = Eval('prod_id')". Obviously that doesn't work with the DataBinding so how can I assign a variable (being the current product id) and append it to the search string.

If you want to see the code, I will post it in about 18 hours time (I'm at home posting this before I go to bed, hoping that I might get an answer over night).

Any ideas on the best way to do this?

Thanks in advance.

make query like sql = SELECT * FROM comments WHERE prod_id = varprod_id

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.