.NETGURU
Searching in a dataset
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.csharp.

Post a new message to this list...

Mojtaba Faridzad
Hi,

I don't know how I can search in a dataset. I can trace the table by DataRow
and foreach loop. but you may know a better way. I have a datagrid and a
textbox. when user type a string in textbox, I need to search in datagird
and change the current record to the found record.

thanks

Reply to this message...
 
    
Sushant Bhatia
You can convert your dataset into XML and then use XQuery to search
through the xml. I'm not sure that it is actually faster though
because if you are doing frequent Selects from the database instead of
just "caching" the result into the memory, then its definately not
fast.
Sushant

"Mojtaba Faridzad" <Click here to reveal e-mail address> wrote in message news:<Click here to reveal e-mail address>...
[Original message clipped]

Reply to this message...
 
    
Lord2702
You really want to search a particular column in your table, right. use
DataTable Search method, this allows you to pass a filter.
Sometimes it is good to read MSDN.

Good Luck.

"Mojtaba Faridzad" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Mojtaba Faridzad
Hi there,

I looked into MSDN and I found "DefaultView" and "Compare" which help to do
a search in DataTable. but I am looking for something else. I don't want to
filterize my DataTable. I want to keep the same table just change the
current record. I used to work with Foxpro and in that language we had
"seek" or "locate" command which helped me to find a record in a table. do
we have a method like them in DataTable?

thanks again

"Lord2702" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
sandman
Maybe DataTable.LoadDataRow will work for you.

sandman

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Reply to this message...
 
    
Mojtaba Faridzad
thanks Sandman. I checked LoadDataRow method. this method searchs for a row,
if not found, adds it. I don't want to add a new row. I'd like to do a
search base on a column.

"sandman" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Data.DataRow
System.Data.DataTable




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification