How to query the table in a dataset?

  • Thread starter Thread starter Cylix
  • Start date Start date
C

Cylix

I am using vs2003,
How can I do the job like
select studentID from student where studentName='Jay'
Do I need to iterate the datatable of the dataset row by row?
Or I can query it?
 
Cylix,

This is the most simple AdoNet there is.

There are probably hundreds of solution for this, therefore can you tell
something more.

Basicly you can use a DataReader, a DataAdapter(which uses a datareader) or
a TableAdapter (which is an inherited datadapter), those standard in the
tasts for Oracle, for SQLClient or for OleDB.

So can you write something more what is the goal from this select?

Cor
 
Cylix said:
I am using vs2003,
How can I do the job like
select studentID from student where studentName='Jay'
Do I need to iterate the datatable of the dataset row by row?
Or I can query it?

In 2005 (not sure about 2003) results can be filtered via
DataTable.Select().

B.
 
Cylix,

I see that I have misread your question.

In my idea is the simplest answer on your question.

Datatable.defaultview.rowfilter = "studentName = Jay"

Both a select and this one returns a table however the dataview (what is
this above) is about the original table.

You can access this table now by
Datatable.defaultview

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top