Creating a Dataview from a Dataset using SQL?

S

Simon Verona

I'm probably missing the obvious.

I have a dataset that is built in code (it has a single datatable) that I
want to populate a datagrid based on an SQL statement that I want to run
against the dataset.

I can't work out though how to create a dataview from the dataset using an
SQL statement.

Have I missed something stupid?

Thanks
Simon
 
M

Miha Markic

Hi Simon,

Each DataTable has a DefaultView property (you can create as much DataView's
as you want) that lets you filter and sort rows. If this isn't enough for
you then you might take a look at
http://www.queryadataset.com/
 
S

Simon Verona

QueryaDataSet looks exactly what I need. Didn't think I'd missed anything!

Thanks
Simon
Miha Markic said:
Hi Simon,

Each DataTable has a DefaultView property (you can create as much
DataView's as you want) that lets you filter and sort rows. If this isn't
enough for you then you might take a look at
http://www.queryadataset.com/

--
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

Simon Verona said:
I'm probably missing the obvious.

I have a dataset that is built in code (it has a single datatable) that I
want to populate a datagrid based on an SQL statement that I want to run
against the dataset.

I can't work out though how to create a dataview from the dataset using
an SQL statement.

Have I missed something stupid?

Thanks
Simon
 
C

Cor Ligthert[MVP]

Simon,

You know as that you don't use a datatable that does not need to be
serialized and/or don't used in a strongly typed datatset, then you can use
the datatable direct in your actions.

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

Top