SQL SELECT query on DataSet(not fill)

M

Mrozu

Hi

I need execute SELECT SQL query in DataSet. No in SQL
server(da.selectcommand) and fill dataset, only show in datagrid
filtered by select-where query records from dataset:) For example I
fill dataset(ds)
da.selectcommand.commandtext="select * from xxx"
da.fill(ds.tables(0))

and when i write
datagrid.datasource=da.tables(0)
datagrid show me all records, but here i need something, i don't know
what, maybe DataView wich allow me to show in datagrid only records
WHERE for example city=London. Is it possible?? maybe RowFilter??

Mrozu
 
C

Cor Ligthert [MVP]

Mrozu,

ds.tables(0).DefaultView.rowfilter = "city = 'London'"
datagrid.datasource=ds.tables(0).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

Top