473,657 Members | 2,456 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataAdapter.Fil l() Misses out on one row of data


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.O LEDB.4.0;data source
= C:\\leedsuni\\m scproject\\seco nddemo\\snomede pr.mdb;";

//Initialise string representing the query to search the
database
string query = "SELECT * FROM abdominalpainas sessmentrecords
WHERE assessment_id = " + assessmentIDTex tBox.Text + "";

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

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

Jul 22 '06 #1
1 1732
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

Jul 22 '06 #2

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

Similar topics

5
2246
by: randy | last post by:
Hello all, I have a DataTable which I am building column by column and adding rows after each new column. The DataTable columns match the columns in my database table. I'm building the DataTable first and I then want to roll through the DataTable while in memory checking for errors and then commit the rows to my database table (btw this is in ASP.NET). Is it possible to have data in a datable before attaching at DataAdapter? I'm a...
5
4562
by: JJ | last post by:
Hi, I created a DataAdapter, connection object and dataset generated from DataAdapter by dragging DataAdapter compenent to win form. Now in the code behind I want to use that DataAdapter. I go to use the dataset that was generated from DataAdapter and I get an Object ref error. So do I have to go through the steps in code behind to reinitate the SqlDataAdapter and DataSet that I generated on the form? If so whats the purpose of having...
1
1800
by: yma | last post by:
Hi, I tried to use a listbox to display a column in MS Access 2000 nwind.mdb by using ole DataAdapter, Connection and dataset controls. But I got "It is already opened exclusively by another user, or you need permission to view its data." I put ole DataAdapter, Connection and dataset controls and fill in the properties of the listbox. The only code I have is OleDbDataAdapter1.Fill(DataSet11, "employees") in page_load sub. How can I...
20
1656
by: TJ Doherty | last post by:
Need help understanding the following please: When I am creating a project and code my connection using Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=C:\Temp\NW-test.MDB", everything works correctly when I run the project. However, if I set up the exact same connection using the DataAdapter wizard and try to run the project, I get a "Microsoft Jet database engine cannot open the file..." error.
13
2080
by: Doug Bell | last post by:
Hi, I thought I had this sorted this morning but it is still a problem. My application has a DataAccess Class. When it starts, it: Connects to a DB (OLE DB) If it connects it uses an OleDbCommand with an SQL String and the connection it has a DataAdapter with the command then it fills the DataSet's DataTable with the streamed data.
8
2689
by: Zorpiedoman | last post by:
I keep getting a concurrency exception the second time I make a change and attempt to update a dataadapter. It appears this is by design, so there must be something I can do to avoid it. Example: I have a dataadapter that contains one table with one row. I change the value of the 'FisrtName' column in that row from Jack to John. I call ..update on the dataadapter it goes through fine. Now I change that same column in that same row...
5
5039
by: George | last post by:
I have set DataAdapter.AcceptChangesDuringUpdate = true; However, I find that I still need to call AcceptChanges on the associated DataTable, DataTable.AcceptChanges(); Has anyone encountered that? Am I not setting this field properly? The following are some of the snippets of the codes which may help explain
0
4546
by: mike1402 | last post by:
Hi ! I get the error below sometimes when retrieving a big amount of data using Datadapter.Fill(dataset,"table"). But when I send the command Fill again, there is no error. Is it a fault of IBM.Data.DB2.iSeries; Version: v1.0.3705 (is there an newer one for OS/400 Version ist V5R3 ?) or is it a hardware faoult (memory of as400 or pc) ? br mike Es wurde versucht, im geschützten Speicher zu lesen oder zu schreiben. Dies ist häufig ein...
2
35367
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a timout problem when I call "DataAdapter.Fill". When I debug, I see that all timeout settings are correct, ConnectionTimeout is 0 and also CommandTimeout is 0. But when I call the fill method I get: "Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding."} System.Exception {System.Data.SqlClient.SqlException}
0
8392
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8305
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8823
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.