473,394 Members | 2,071 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,394 software developers and data experts.

implementing effective searching in the business code(with linqmaybe)

hi,

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
5 1070
I think your send button is stuck. You have posted the same question three
times now. The first time has been answered.
"giddy" <gi*******@gmail.comwrote in message
news:1f**********************************@r15g2000 prh.googlegroups.com...
hi,

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 #2
Jeez, this happens every now and then, but this time, i posted and it
didn't show up in the forum for a couple hours I think, then i posted
again.

What do you guys use to post here, I use google groups.

Thanks so much

Gideon
Oct 6 '08 #3
I use Windows Mail on Vista, and
http://www.microsoft.com/communities...s/default.aspx from XP.
They all have quirks though...

"giddy" <gi*******@gmail.comwrote in message
news:9d**********************************@i20g2000 prf.googlegroups.com...
Jeez, this happens every now and then, but this time, i posted and it
didn't show up in the forum for a couple hours I think, then i posted
again.

What do you guys use to post here, I use google groups.

Thanks so much

Gideon
Oct 6 '08 #4
I use Windows Mail on Vista,
Interesting, can I use outlook to post and maybe see replies??

Thanks so much
Gideon
Oct 8 '08 #5
On Wed, 08 Oct 2008 01:26:31 -0700, giddy <gi*******@gmail.comwrote:
>I use Windows Mail on Vista,
Interesting, can I use outlook to post and maybe see replies??
Outlook Express (the predecessor to Windows Mail) has decent newsgroup
support (the only major bug I'm aware of has to do with failing to quote
properly when the replied-to message is encoded in one of a set of
particular encodings).

On Windows, there are lots of other options, including 40tude, Forté
Agent, Thunderbird, and Opera. Note that with any newsreader, you'll need
to point it at a specific news server. For any of the
"microsoft.public..." newsgroups, you can use Microsoft's own public
server. I believe you can access it with either "news.microsoft.com" or
"msnews.microsoft.com".

Pete
Oct 8 '08 #6

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

Similar topics

0
by: James Smith | last post by:
When I am trying to compile c# code with visual studio 2003 it takes about ten times longer than it should. It appears t be trying to connect to various servers and times out on three of them which...
5
by: warteschlange | last post by:
i want to postload javscript from another javascript. This works fine in firefox and IE6 for macIE i can use an Iframe to load the code and inject it with insertAdjacentHTML The problems arise...
52
by: entropy123 | last post by:
Hey all, I'm working with some legacy C code and I would like to compile it as a CPP file. I get the following error message: driver.cpp:87: cannot convert `void *' to `GenericStruct *' in...
1
by: J.Artieda | last post by:
I compile one object using gcc and another using g++ then i use g++ to link the to objects and i get that the fuctions of the c object are unknown references for the c++ object. can any body...
1
by: Robert V. Hanson | last post by:
Please give me some ideas on how to setup the ability to test System.Web.Mail code to send emails using just my development computer, Win2000Pro OS and IIS5.0? Thanks, Bob Hanson
7
by: sck10 | last post by:
Hello, I have the following sub in a class in my "App_Code" directory. The script is for setting focus on a particular control, but I get the error, "Name ClientScript Not declared". Also, I am...
9
by: Eric Lindsay | last post by:
I can't figure how to best display little snippets of shell script using <pre>. I just got around to organising to bulk validate some of my web pages, and one of the problems occurs with Bash...
23
by: Babak | last post by:
Hi Everyone, I've written a standard C code for a simple finite element analysis in MSVC++ . When I save the file as a cpp file, it compiles and runs perfectly, but when I save it as a c file,...
1
by: drchaos | last post by:
Placing HTML code with inline javascript into a div both as rendered HTML(the intended final purpose) and shown as RAW text HTML (for the user to copy and paste into their own webpage.) Here is...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.