Click here to Skip to main content
16,001,543 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have 2 tables one for item which contain itemid,itemname,showinstore,manufacturer and a adminfield which consist of adminname, adminid, levelid, companyid.

Now when i enter any product and click on showinstore then the data is inserted in another table permission which contains itemid , adminid. Now when showing the items for order i want to bind them and write the query for showing the items based on belowd condition.

All the items will show from table permission. All the items show whose companyid == manufacturer .

Not able to understand how i write this query.
Posted
Updated 18-Oct-11 0:17am
v2

1 solution

Hi,

Try this once it can helps you

C#
string qry="select * from ItemTab where manufacturer='"+Session["compid"].tostring()+"' and itemid in (select itemid from ItemPermissionTab where adminid='"+Session["userid"].tostring()+"')";


you can get items which are placed in item permission table and that admin company id

All the Best
 
Share this answer
 
Comments
Vimalrashamra 18-Oct-11 7:06am    
How come it identify the adminid without using the itemtab bcoz adminid is in another table
Muralikrishna8811 18-Oct-11 7:08am    
yeah adminid is in another table but the same fields are itemid right
so we can show specified items to that admin

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