473,473 Members | 1,875 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to query the table in a dataset?

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?

Aug 14 '06 #1
4 4400
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" <cy*******@gmail.comschreef in bericht
news:11**********************@74g2000cwt.googlegro ups.com...
>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?

Aug 14 '06 #2
Hi,

You can use datatable.select to find a record with its primary key.
Dataview.find will return the row number on a sorted column.

http://msdn2.microsoft.com/en-us/library/h71xaeh0.aspx

http://msdn2.microsoft.com/en-us/library/18kktzs4.aspx

Ken
------------------------
"Cylix" <cy*******@gmail.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
>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?

Aug 14 '06 #3

Cylix wrote:
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.

Aug 14 '06 #4
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
"Cor Ligthert [MVP]" <no************@planet.nlschreef in bericht
news:Od**************@TK2MSFTNGP06.phx.gbl...
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" <cy*******@gmail.comschreef in bericht
news:11**********************@74g2000cwt.googlegro ups.com...
>>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?


Aug 14 '06 #5

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

Similar topics

7
by: Phin | last post by:
I need your HELP! I've seen all the posts on using Crystal Reports within vs.net (vb.net) and changing a SQL query at runtime. When I tried to pass in a dataset into the crystal report at...
2
by: Matthew Kramer | last post by:
Once you have created a table through a query, is there a way to make that dataset into an Access "table" rather than a table/dataset generated by a query? Maybe someway to cut and paste the...
2
by: Andrew Mueller | last post by:
Hello, Since I cannot query a DataSet directly, and I would like to maintain it's data, how would I use an adapter (SqlDataAdapter or DataAdapter) to query this DataSet. Example: Could I? ...
4
by: Derek Van Cuyk | last post by:
Hi everyone! I'm trying to write a web application in school that utilizes a MS Access database. I can read and everything fine from it but when I try to add a new record I get an exception that...
1
by: cindy | last post by:
Get data into datatable, add to dataset dsSearch " Get data into datatable, add to dataset dsSearch Using In-Memory SQL Engine join the tables and select the filenames from the join, add to...
1
by: Mat | last post by:
I have typed dataset in applications, which contains table A(ID,name) , B(ID,A1, B1,B2) Table B has columns A1 as foreign key ,primary key of table A i want to bind dataset or dataview to...
2
by: forforumsid | last post by:
Hi all I have a Dataset name: dsMain I popullate with all the data from the database on form load event I have a requirement to filter data as per users requirement on a button click event ...
2
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
How can I run this query against a table in my Access database? I don't know hwo to use it in C#. In VB I would use .Recordset = "some sql statement". How do I do this in C#? //I get a vlaue...
3
by: nannu | last post by:
Hi, i am using the following query string query = "SELECT *"+ "FROM DataSet"+ "WHERE Param_ID =(Select Data1 from testcases where TestCaseID='TC001') DataAdapter da=new DataAdapter();...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all On SQL Server tables I use SqlDataReader to query data like "SELECT * FROM table". Is there something similar for XML Files ? I want to use SQL Syntax like "SELECT * FROM table" on a...
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
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...
1
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...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.