473,396 Members | 1,900 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,396 software developers and data experts.

implementing effective searching in the business code[maybe withlinq?]

hi,

Yes its a design question again. =)

If I have something like:
class Person
{
//functions:
static Person[] GetAllPersons();
static Person[] Search(string field,string value);
}

In the second function I would do something like build an sql query
like this:
>SELECT ........... WHERE field = value
and send it through another data class to retrieve the right Persons.

eg:
Person[] teens = Person.Search("Age",18);

Firstly the biggest problem searching with AND, >,<, OR, Between etc.?
Which terribly limits the search.I could make more functions for that,
but its turns into a little bit of a mess. Is there a better/more
generic way to build a query on the fly?

Would I benefit by using Linq instead/would it be more efficient to
load all persons in memory and then search them with linq? If I were
to use linq how again would I write a function to build a query on the
fly?

Thanks so much

Gideon
Oct 5 '08 #1
0 813

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

Similar topics

7
by: borges2003xx | last post by:
hi everyone. a problem: two binary strings, a="0101" b="000011110100"; i search a function f(a,b) that gives 1 if a is "contained" in b with any sub strings interposed. in this example a in...
242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
5
by: Steve1 via DotNetMonster.com | last post by:
Hi all, Whats wrong with the below code? On every loop it seems to be jumping 3 sometimes 4 records. As you can see the SQL query is asking for all records with no filters. I want to loop...
39
by: Abubakar | last post by:
I want to get characters for given ascii codes. Dont wanna use the CHR or ChrW functions. What r the .NET equivilents of the Chr & ChrW functions? Regards, Abubakar.
16
by: sailor.gu | last post by:
Hi all guys, As an embeded programmer with five year C experience, I did read many great books related with design, coding, test,debug,algorithms, compiler, design, os, pm and others. I...
4
by: Zytan | last post by:
I've sent the error report. But does that contain my code? I would imagine not, since it's a privacy concern. Can they really fix the problem without code? Maybe, but maybe not. I don't care...
2
by: emmettnicholas | last post by:
Hi, I realize that eval() is generally discouraged, but I've found myself wishing that I could execute user-generated code. One idea I've seen is to use token_get_all(), and then make sure no...
52
by: Bill Cunningham | last post by:
I thought I would post this code. It seems to do what I want it to but I thought I would have it critiqued. I use C89 but I think that maybe some of the code maybe misplaced. For example, the fopen...
2
by: giddy | last post by:
hi, Yes its a design question again. =) If I have something like: class Person { //functions: static Person GetAllPersons(); static Person Search(string field,string value);
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: 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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.