Newbie: help with datareader

S

steve

Hello,
I have the follwing "decision-making" problem:

- I want to construct an interface with a few radios, listboxes etc so that
a user can, by selecting some or all of them, dynamically create an SQL
string. This is fine, and i have an example to consult.

- *After* the string is constructed what is the best way (SIMPLEST) to
*display AND store* the data? Datareader or Dataset?

-->>>My biggest problem is that I dont know at design time the number of
fields that will be returned from the query !!!
It depends on the user's selections.
So I *cannot* decide beforehand the number of columns on a multicolumn
ListView or listbox etc. that will be needed to display the result.

Remember that I need to store the result as well, for further processing
(statistics,etc.) so should i use an array for that?

Any suggestions / links would be appreciated !
TIA
-steve
 
G

Guest

It depends on what you are doing with it. The DataReader is faster, as it is
a forward only cursor (aka, a firehose cursor). But, you have to write any
insert, delte or update logic separately. A DataSet is better when you want
to perform something other than select logic, but it comes at a slight perf
penalty. You can also get row counts, etc., with a DataSet.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
 

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