Click here to Skip to main content
15,895,462 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to get data base values based on column name using linq,I wrote below code for calling services in my page i.e mypage.cs
C#
public IEnumerable<SKUDvo> getdatabysku(object sku)
       {
           return productService.getdatabysku(sku);

       }

And i am calling below services from above code
C#
 public IEnumerable<SKUDvo> getdatabysku(object sku)
        {
       
             eshop_dbContext dbcontext123 = new eshop_dbContext();
            
 var productinfoQuery321 = (from productInfo321 in dbcontext123.ProductMasters where productInfo321.SKU == sku select productInfo321);


             IList<SKUDvo> productList123 = new List<SKUDvo>();
             foreach (var proitems in productinfoQuery321)
             {
                 productList123.Add(new SKUDvo
                 {
                     skuno=sku,
                     ProductId = proitems.ProductId,
                     CategoryID = proitems.CategoryID,
                     ManufaturerId = proitems.ManufaturerId,
                     ItemNo = proitems.ItemNo,
                     ProductName = proitems.ProductName,
                     DeletedInd = proitems.DeletedInd,

                   
                 });
               
             }
             return productList123;
}
But my problem is when i am passing value like "MILANO 63450" in url the value not moving to
mypage.cs. 

             

Please help me out i want to pass object type value in mypage.cs page
Posted
Comments
johannesnestler 2-Sep-13 8:14am    
Hi Sarath, Few questions: you didn't mention that your problem is possibly related to wrong URL, also the title is missleading - if I understand you right you don't have any problem with with LINQ nor EF... But I'm wondering if a reference equality of your "sku" object with the productInfo321.SKU is what you want... Finally you are asking for help to pass a "object" typed value (=everything) to a page. So maybe you clarify what is your Problem: EF/LINQ, URL-(Parameter) handling, or problems with types and equality and Show relevant code for that problem...

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