PC Review


Reply
Thread Tools Rate Thread

DataAdapter.Fill() Misses out on one row of data

 
 
Deecrypt
Guest
Posts: n/a
 
      22nd Jul 2006

My issue is that I am communicating data between a website and a
webservice using datasets. The datasets created by filling the
datasets with results of queries using the DataAdapter. My problem is
that for some reason, the fill method seems to miss out on exactly one
row from the database even though that row still conforms to the query
criteria. Regardless of how many rows are selected as a result of the
query, only the last row logically present in the table is not copied
into the dataset. Below is my code. May be there is something I am
overlooking.


//Assign the type and destination of the database being queried
string source = "Provider = Microsoft.JET.OLEDB.4.0;data source
= C:\\leedsuni\\mscproject\\seconddemo\\snomedepr.mdb;";

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainassessmentrecords
WHERE assessment_id = " + assessmentIDTextBox.Text + "";

//This dataset represents what has just been edited and saved
in the aap database
OleDbDataAdapter aapDataAdapter = new OleDbDataAdapter(query,
source);
DataSet aapDataSet = new DataSet();
aapDataAdapter.Fill(aapDataSet,
"abdominalpainassessmentrecords");

I'm just wondering what would make the adapter miss one row that still
conforms to the query criteria. It just seems like a bug to me.

Thank you kindly

Khurram

 
Reply With Quote
 
 
 
 
Khurram
Guest
Posts: n/a
 
      23rd Jul 2006
Managed to fix it. For all those out there with similar problems, I
simply separated the part that was querying the database and returning
the dataset from its original code setting and placed it in a method on
its own. This also meant that the database connection needed to be
established again, however this meant that there was data missing now.

Thought i'd share

Khurra

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using DataAdapter.Fill() Micus Microsoft ADO .NET 4 24th Oct 2006 09:23 PM
copying a profile, misses local settings so misses email q_q_anonymous@yahoo.co.uk Microsoft Windows 2000 8 26th Jun 2006 03:13 AM
Why not need ref when dataAdapter.Fill ad Microsoft C# .NET 3 7th Feb 2006 07:19 AM
system.data.odbc.dataadapter fill bug? (framework 1.1) Candida Microsoft ADO .NET 1 7th Jan 2005 01:33 PM
Newbie question-DataAdapter Fill errors with any null data PeteJ Microsoft ADO .NET 4 10th Jun 2004 10:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:29 AM.