Query a DataSet Table in Visual Studio 2005

F

forforumsid

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

What I want is that when the user clicks the button the program should query the Dataset table and not the database table and return the result

So basicly I want to know how can I use T-SQL statements on a Dataset table and get result.

If somebody can help me out with this and provide some examples of this will be of great help.

Regards,
Mayank
 
C

Cor Ligthert [MVP]

MaybTank,

A dataset is not an SQL type database. It is a set of tables and relations.

You can however query it with the inbuild DataTable Select which has its own
query expression language, however that is not T-SQL. Beside that there is
the dataview for filtering and sorting.

In future there will be LINQ to improve that Expression language, which is
at the moment very poor.

Cor
 
R

RobinS

What are you trying to accomplish? Are you just wanting to let the
user filter the displayed data? You can do this by binding the
data to the grid or whatever control you are using. Use a
binding source between the data source and the control(s).
Then if you apply the filter to the binding source, it will
filter the dataset entries available to the control(s).

Robin S.
 

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

Top