473,320 Members | 1,794 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

dataset reuse

tg
i have a strongly typed dataset that i will continually refill with
different data using SQL queries and want to process the data in each.

I get the first dataset fine, using a SQL command object and using a
dataAdapter.Fill() etc, and everything works fine. If i want to refill
that dataset with new data using dataAdapter.Fill() again, it doesn't
work. instead, the old data still remains in the dataset.

i've tried using the Clear() and Reset() methds of the dataset before
calling dataAdapter.Fill() with no avail. Here's some pseudocode to
help explain what i'm trying to do.

JobsDS ds = new JobsDS() // my custom dataset
....
//setup the data adapter, sql connection, command object
....

bool done = false;

while(!done)
{
// jobs is the table i'm always pulling data from.
da.fill(ds, "Jobs");
// process dataset with the new data from the above line

if( done_processing)
done = true;
}

Dec 22 '05 #1
2 3258
tg wrote:
i have a strongly typed dataset that i will continually refill with
different data using SQL queries and want to process the data in each.

I get the first dataset fine, using a SQL command object and using a
dataAdapter.Fill() etc, and everything works fine. If i want to refill
that dataset with new data using dataAdapter.Fill() again, it doesn't
work. instead, the old data still remains in the dataset.

i've tried using the Clear() and Reset() methds of the dataset before
calling dataAdapter.Fill() with no avail. Here's some pseudocode to
help explain what i'm trying to do.

JobsDS ds = new JobsDS() // my custom dataset
...
//setup the data adapter, sql connection, command object
...

bool done = false;

while(!done)
{
// jobs is the table i'm always pulling data from.
da.fill(ds, "Jobs");
// process dataset with the new data from the above line

if( done_processing)
done = true;
}


Are you sure that the Dataadapter has the new sql query?

Chris
Dec 22 '05 #2
tg
yes. well, i set the command text to the new value i want it to have.
after the initial setup, i try to do this to "refill" the dataset with
new data:
cmd.CommandText = "SELECT ...."
// i've tried calling dataset.Reset() and dataset.Clear() here
int result = dataAdapter.Fill(dataset, "Jobs")
// result here is zero even when i know the query should return rows

Tyler

Dec 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: GM | last post by:
-What is the advantage of placing the dataset into the designer? -is it possible to share adapters across webforms? -is it possible to created a set of adapter with one dataset to reuse across...
7
by: Jason Huang | last post by:
Hi, The SQL string is "select * from Customer where 0 > 1", and the DataSet should be null. Why MyDataSet.Tables.Count is 1, not 0? What kind of DataTable in this place? Thanks for help. ...
0
by: martin | last post by:
Hi, I am storing a dataset in cache, which is happening fine. I can easily retrive it at postback from the cache, cast it to a dataset and reuse it. However I have specified that the cache...
4
by: Craig Buchanan | last post by:
I would like to reuse a SQLDataReader that is populated with information as the datasource for multiple dropdownlists. Unfortunately, the first DDL closes the SDR and my code fails on the second...
15
by: ruca | last post by:
Hi, Can I read a .TXT File to a DataSet? How can I do that? I want to read his lines to a DropDownList. This lines are the names of employees that I export from an application that I have. I...
10
by: Victor | last post by:
Hello there, I have a module in VB.NET (ASP.NET) and on top I declare the SqlConnection and the SqlDataAdapter. Like: Module AccessDB Dim sqlCmd As New SqlCommand Dim conAanvraag As New
2
by: Sandy | last post by:
Hello - I have the following stored procedure and code. I want to put the results in two textboxes. I get to the part where I create the dataset and then I don't know what to do. I tried...
5
by: apandapion | last post by:
I'm working with csharp and .net for the first time, and I've had a fair amount of luck. I started with the MSDN "Walkthrough : Creating a Distributed Application" tutorial and expanded from...
7
by: =?Utf-8?B?ZG91Zw==?= | last post by:
Have loaded balanced web servers that we do not allow to connect to our database. Content is created and pushed to these sites. I want to add a web service that may get multiple requests a second...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.