hi guys
i have two tables tablea(PK) and tableb(FK)
now i just want to load only data from tablea not from tableb
but when i do
var qry = from result in con.tablea
select result;
return qry.tolist()
but it gives me also the data from tableb , althoug when i see
the sql query from con.log i just see it getting data from table a , why is that?
if the query is pointing to just tablea so why there are records from tableb?
thanks.
Loading
Sam HobbsPosted Nov 21, 2009, 11:00 AM
If I understand what you are saying, then the answer depends on your program. You simply need to remove the code that fills the orders list, or use a parameter of some type that your program uses to determine whether to fill the orders list. I don't know how your program works so I can't tell you how to do it. I think no one else knows otherwise they would have helped you already.
Tauseef KhanPosted Nov 20, 2009, 1:45 PM
querying for customers,it should only fetch customers .in order list it shoud be empty or null as i am just querying customers.
is not that overhead , coz i just want 5 customers and it is bringing 200 * 5 orders 200 for each .
Sam HobbsPosted Nov 20, 2009, 2:46 AM
Tauseef KhanPosted Nov 17, 2009, 8:10 PM
in northwind data base , get customers with the query
var qry = from customers in datacontext.customers
select customers;
and you can get even orders by each particular customer , i dont want that
i just want customers data not orders related to each customer.
now on user interface side
if i do
list
//the above query will be called in the GetCustomers method.
list
so here ordlst will give all the orders , i dont want that , i hope you will understand ,now.
Sam HobbsPosted Nov 17, 2009, 4:47 PM
The thing I would do is to write a small simple sample that duplicates the problem, along with a small amount of data. You need to write a program that duplicates the problem but does nothing more than it needs to do to duplicate the problem. Sometimes that takes a few hours, but for this problem it seems it can be done in a few minutes. This might seem like too much work but it is what I would do and I have done when I needed help such as this. I usually solve the problem myself when I write a small program that I can use to play with. If you don't solve the problem yourself with the small sample, then post the small program here and some data to use to run the program.
Tauseef KhanPosted Nov 17, 2009, 2:41 PM
Sam HobbsPosted Nov 17, 2009, 12:03 PM