what ado.net object to use problem

G

Guest

I need to accomplish this tasks:
1. i need to query sql database
2. check if null, if not continue
3. check a certain column if null,if not continue
4. filter or split the data into two sets, these 2 will be the datasources
of two gridview.

i can use datareader to query sql database, check if its null (using
datareader.hasrows), and check if certain column if null; however i cant use
datareader to filter rows into 2 sets. To achieve this, datatable has select
method or dataview has rowfilter method. Now how do i transfer data from
datareader to datatable or dataset/dataview? As much as possible i want a
single database query so the web app will be faster.

Thanks.
 
C

Cowboy \(Gregory A. Beamer\)

1. Get data
2. Check if talbe has rows
3. If so, check if certain column is null
4. If not, add two DataViews onto the DataSet and filter each appropriately
for binding.

That is the easiest if you HAVE to have a single table.

If not, you can still take one trip by asking both questions at the same
time (for example, in a single stored procedure).

--
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