开发者

operator > < on sql c# asp.net

I have page.aspx , i have label that shown what is the minimum number (from item table, sql) to open an auoction ...example - the minimum number value is 5... after i got 5 bids (from table: purchase) - the auoction start and开发者_JAVA技巧 at other lablel shown img: V. while the number of purchase small then 5 - i want to show X image.

i have two tables:

items (id, minNumber)

purchase (id)

when user buy somthing the id value up by one..(example: if i bought banana so i got the id one..after that i buy ball - i got the id 2.)

the question:

how can i use the operators > < = at code behind with the use of sql tables....

i'm very new at sql. i'm usually use LINQ to SQL.. or sql cmnd at code behind.LINQ like:

using (DataClassesDataContext myDataContext = new DataClassesDataContext())
{
  var bla = from items in myDataContext.items 
         ..................
    }

but how to continue?

i'v been tried:

               var Tokef =
                from items in myDataContext.items
                from purchase in myDataContext.purchases
                if (items.Minbuy == purchase.purchaseid) {
                   Image2.Visible = true; }

but it doesnt work !!


try something like

 string sql = "Select * From items Where id LIKE '" + ID + "' AND minNumber <>= '" + minNumber+ "'";

for Linq to SQL try something like:var items = from p in db.items where p.ID == "someValue" AND p.minNumber <>= "somevalue" select p;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜