Select Statement without using connection.

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

Hi, I have created a dataset programmatically.
I want to be able to run sql statements on this if
possible, however I can't seem to get around the fact that
I have to set up a connection, problem is obviously I have
nothing to connect to, I'm sure i'm doing something basic
wrong here but can't figure what. Anybody any ideas.
 
Hi Barry,

What will you do with that dataset?
- Write it to a disk use dataset.writeXML('Path')
- Select data from it, use dataset.tables(0).select(selectstatement)

But give some more information, this to much gambling?

Cor
 
The DataSet is a repository, not an SQL server. DataAdapter conveys data
between DataSet/Table and Database source. Connection is required to connect
to Databas Source.

Regards - OHM
 
Hi Cor,
I am using a very simple series of dates - bank holidays
that I upload via a comma delimited file, I got code to
make this into a dataset, I would ideally like to run sql
type statements here, it does not have to be a dataset if
I can change the code - I basically just want to find a
date in the data as quickly as possible that is without
using a loop as i do at present.
Thanks for your help,
Barry.
 
Barry said:
Hi, I have created a dataset programmatically.
I want to be able to run sql statements on this if
possible, however I can't seem to get around the fact that
I have to set up a connection, problem is obviously I have
nothing to connect to, I'm sure i'm doing something basic
wrong here but can't figure what. Anybody any ideas.

A dataset is not a database (a DBMS) that can execute SQL statements. It is
only a data container. There are some ways to filter data. There is the
DataView class, a DataTable has a Select function, and the DataRowCollection
has a Find function.

Further ADO.NET related questions:
microsoft.public.dotnet.framework.adonet
 
Thank you very much for all of your help, I am using the
select method of the datatable now, it works fine for what
I want to do.
 
Back
Top