473,387 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A Possible Scenario for LINQ

Just wondering if LINQ might be useful and appropriate in the following
scenario:

I'm writing a Windows Forms app that enables the user to search for a
"client account". The client account is made up of a client number, plus a
case number. A given client can have many cases.
Here are two clients - the first of which has two cases.
1234-897
1234-989
7654-232

The application will encapsulate each client+case and related data in
separate objects (along with a list of financial transactions relevant to
the particular client+case). This class will have properties for client
number, case number, client name, and a List<Texposing the financial
transactions. DAL type methods will provide for saving changes to the DB
(SQL Server).

Here is where I'm thinking LINQ might come in: The user will need to search
for a specific client+case. The search could be by (1) client number, (2)
client+case number, or (3) client name.

During the search I'm not going to SQL for this data (so no LINK-to-sql).
The objects will loaded into memory during app startup; the search and UI
will then provide access to those in-memory objects.

Is the search functionality a good place to go with LINQ? Or should I go
with a List<Tand Predicate delegate.

I'm just starting the design of this, so I can do anything I want to do

I appreciate your opinions on this.
Nov 5 '07 #1
1 1323
Bob,

I think it is a good place to use LINQ. You could easily generate
queries which will search based on the properties of the object you want to
search on.

However, depending on how large the list is, you might want to try and
optimize your collections. For example, if you get a client number/case
number combo, you might want to have lists of case numbers that pertain to a
client stored in a hash table. That way, you can get the list of case
numbers easily for a particular client.

It's really a way if indexing, if you think about it, which you can
still use LINQ to help you out with.

If your client objects expose collections of cases, then that would make
it even easier, since you already have performed most of the grouping ahead
of time.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bob Johnson" <A@B.comwrote in message
news:uM**************@TK2MSFTNGP02.phx.gbl...
Just wondering if LINQ might be useful and appropriate in the following
scenario:

I'm writing a Windows Forms app that enables the user to search for a
"client account". The client account is made up of a client number, plus a
case number. A given client can have many cases.
Here are two clients - the first of which has two cases.
1234-897
1234-989
7654-232

The application will encapsulate each client+case and related data in
separate objects (along with a list of financial transactions relevant to
the particular client+case). This class will have properties for client
number, case number, client name, and a List<Texposing the financial
transactions. DAL type methods will provide for saving changes to the DB
(SQL Server).

Here is where I'm thinking LINQ might come in: The user will need to
search for a specific client+case. The search could be by (1) client
number, (2) client+case number, or (3) client name.

During the search I'm not going to SQL for this data (so no LINK-to-sql).
The objects will loaded into memory during app startup; the search and UI
will then provide access to those in-memory objects.

Is the search functionality a good place to go with LINQ? Or should I go
with a List<Tand Predicate delegate.

I'm just starting the design of this, so I can do anything I want to do

I appreciate your opinions on this.

Nov 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Dave Johnson | last post by:
Greetings, i want to be able to use linq new technology with sql server. the senario i am not able to do so far is as follow: 1- i program with linq 2- be able to generate and manipulate...
4
by: cj | last post by:
Can I use LINQ in VB .Net 2008 to get to a Visual FoxPro Table? I've seen demos of it with SQL Server but they've used it with a server browser and I don't think that'd work when I need to see VFP...
9
by: =?Utf-8?B?cmF1bGF2aQ==?= | last post by:
Hi all: after reading different places/sites about linq... I ran into these questions: 1. What framework do we need to run linq ? (does it depend on what version of visual studio we have?) how...
0
by: =?Utf-8?B?SHlwZXJjb2Rlcg==?= | last post by:
I'm encountering some strange behavior after deploying a ASP.net 3.5 website to production, i'm unable to reproduce these in my dev environment. This error seems to occur very randomly but it's...
4
by: =?Utf-8?B?RXJpYyBGYWxza2Vu?= | last post by:
We’re storing our main entity in an insert only table which stores the history of past revisions, but we’re facing problems with storing this history as LINQ will only update the entity, and...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
9
by: Cirene | last post by:
I'm about to begin a brand new, big, ASP.NET project (using 3.5 .net fw), VS 2008. I'm using MySQL as the backend (customer request.) I have absolutely no experience with LINQ and/or the Entity...
3
by: =?Utf-8?B?UGF1bCBQcmV3ZXR0?= | last post by:
I'm attempting to use LINQ to insert a record into a child table and I'm receiving a "Specified cast is not valid" error that has something to do w/ the keys involved. The stack trace is: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.