I have 2 sql tables
items with the desgin:
minBuy (int number)
purchase with the desgin:
id
At items i have c开发者_开发知识库olumn "minBuy" - as long as purchase id not >= to minBuy, i want to show img that display "X". when it's >= i want to display img that shown "V". i'm using sql with c#.
i have the two img's .... v.png and x.png.
how can i do that at c# with
if(purchaseid >= minBuy)
v.visble = true;
i heard somthing about to do fetch, what is it and how that can help me here?
You can do that with a case statement. For example:
CASE WHEN purchaseid >= minBuy THEN 1 ELSE 0 END as MinBuyInd
Now you can use the MinBuyInd column to determine which image to display.
if you have an asp:Image ID="img" tag.
than you can just set the source
if(purchaseid >= minBuy)
img.ImageUrl = "url of V";
else
img.ImageUrl = "url of X";
精彩评论