Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have one table contain following columns

Id,imagename,countRate

there are many rows in table containing different imagesname.

those all images are shown into the front end, after clicking on button with each image increment the countRate of that image. My difficulty is that how can I know that any perticulare countRate is for respected imageName. in where clause what should i have to mention as Id is not known to me.

What I have tried:

I have one table contain following columns

Id,imagename,countRate

there are many rows in table containing different imagesname.

those all images are shown into the front end, after clicking on button with each image increment the countRate of that image. My difficulty is that how can I know that any perticulare countRate is for respected imageName. in where clause what should i have to mention as Id is not known to me.
Posted
Updated 10-Apr-16 18:01pm
Comments
Arvind Zamakia 10-Apr-16 21:13pm    
You can used repeater. Defined images tag and hidden field are stored primary key value.
Kishor-KW 10-Apr-16 23:59pm    
how to do this.please explain

1 solution

This is not possible without setting a PK (primary key) field. This will allow you to identify each column uniquely. If you don't know the ID for the row then set 2 (two) PKs.

WHATS NEXT?
Now you can pick the ImageName from a data control like gridview, datalist or repeater, whenever the ImageName is collected you just have to check the same row for column ID and use it to get the countRate or maybe pick countRate directly from the datarow in the control.

Hope this helps
 
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