473,761 Members | 1,808 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Records not updating

Hi there, I have a simple medical database with patient records. I use:
TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records" to reflect
the number of patients in the db.
I then filter the records per person and update the count with the same
code. My problem is that the actual number of records is always off by one
update. That is to say that initially it reads correctly say 25 records.
Then I filter for person1 which has 3 records. The TotalRecords will read
25 the first time, then I filter for person2, which should read 4 but it
reads 3. Very strange! Any help with this?
Is there a way to cause an update/postback whatever to get the correct
number consistantly?

Thank you, Mark
May 7 '06 #1
3 1424
It appears that you are reading the DataItemCount property before the
filtering takes effect.

What do you use for data source, and what do you do to filter it?

Monty wrote:
Hi there, I have a simple medical database with patient records. I use:
TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records" to reflect
the number of patients in the db.
I then filter the records per person and update the count with the same
code. My problem is that the actual number of records is always off by one
update. That is to say that initially it reads correctly say 25 records.
Then I filter for person1 which has 3 records. The TotalRecords will read
25 the first time, then I filter for person2, which should read 4 but it
reads 3. Very strange! Any help with this?
Is there a way to cause an update/postback whatever to get the correct
number consistantly?

Thank you, Mark

May 7 '06 #2
Hi, and thanks in advance.

* What do you use for data source, and what do you do to filter it?

Protected Sub ListBoxSelectRC P_SelectedIndex Changed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles
ListBoxSelectRC P.SelectedIndex Changed

If ListBoxSelectRC P.SelectedIndex + 1 = 1 Then
DetailsViewMain .DataSourceID = "roomFind1"
ListBoxSelectPa tient.DataSourc eID = "Patientfin d1"
ListBoxSelectRo om.DataSourceID = "RoomFind1"
End If

If ListBoxSelectRC P.SelectedIndex + 1 = 2 Then
DetailsViewMain .DataSourceID = "roomFind2"
ListBoxSelectPa tient.DataSourc eID = "Patientfin d2"
ListBoxSelectRo om.DataSourceID = "RoomFind2"
End If

TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records"

End sub


"Göran Andersson" <gu***@guffa.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
It appears that you are reading the DataItemCount property before the
filtering takes effect.

What do you use for data source, and what do you do to filter it?

Monty wrote:
Hi there, I have a simple medical database with patient records. I use:
TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records" to reflect
the number of patients in the db.
I then filter the records per person and update the count with the same
code. My problem is that the actual number of records is always off by
one update. That is to say that initially it reads correctly say 25
records. Then I filter for person1 which has 3 records. The TotalRecords
will read 25 the first time, then I filter for person2, which should read
4 but it reads 3. Very strange! Any help with this?
Is there a way to cause an update/postback whatever to get the correct
number consistantly?

Thank you, Mark

May 7 '06 #3
Setting the DataSourceID property doesn't perform a DataBind, it only
set the RequiresDataBin ding property. The data binding is done at some
later stage, probably when the control is going to be rendered and
detects that it needs data binding.

You either have to call DataBind yourself before getting DataItemCount,
or get it after the data binding occurs.

Monty wrote:
Hi, and thanks in advance.

* What do you use for data source, and what do you do to filter it?

Protected Sub ListBoxSelectRC P_SelectedIndex Changed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles
ListBoxSelectRC P.SelectedIndex Changed

If ListBoxSelectRC P.SelectedIndex + 1 = 1 Then
DetailsViewMain .DataSourceID = "roomFind1"
ListBoxSelectPa tient.DataSourc eID = "Patientfin d1"
ListBoxSelectRo om.DataSourceID = "RoomFind1"
End If

If ListBoxSelectRC P.SelectedIndex + 1 = 2 Then
DetailsViewMain .DataSourceID = "roomFind2"
ListBoxSelectPa tient.DataSourc eID = "Patientfin d2"
ListBoxSelectRo om.DataSourceID = "RoomFind2"
End If

TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records"

End sub


"Göran Andersson" <gu***@guffa.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
It appears that you are reading the DataItemCount property before the
filtering takes effect.

What do you use for data source, and what do you do to filter it?

Monty wrote:
Hi there, I have a simple medical database with patient records. I use:
TotalRecords.Te xt = DetailsViewMain .DataItemCount & " records" to reflect
the number of patients in the db.
I then filter the records per person and update the count with the same
code. My problem is that the actual number of records is always off by
one update. That is to say that initially it reads correctly say 25
records. Then I filter for person1 which has 3 records. The TotalRecords
will read 25 the first time, then I filter for person2, which should read
4 but it reads 3. Very strange! Any help with this?
Is there a way to cause an update/postback whatever to get the correct
number consistantly?

Thank you, Mark


May 7 '06 #4

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

Similar topics

6
5769
by: Hennie de Nooijer | last post by:
Hi, Currently we're a building a metadatadriven datawarehouse in SQL Server 2000. We're investigating the possibility of the updating tables with enormeous number of updates and insert and the use of checkpoints (for simple recovery and Backup Log for full recovery). On several website people speak about full transaction log and the pace of growing can't keep up with the update. Therefore we want to create a script which flushes the...
28
4058
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during the work day. The backend has a table called CLIENTS with approximately 6000 client records. Changes to data in the table are made via a frontend db Form which has CLIENTS as its record source.
1
2034
by: P | last post by:
Hello, I am having a difficult time updating a record via a stored procedure using the gridview and sqldatasource. I cannot seem to be able to find a way to set everything up so that I can pass the applicable fields in the gridview to a sqldatasource which in turn calls a sproc with the appropriate parameters and data. Any ideas? Thanks in advance,
4
2023
by: Darrel | last post by:
I'm creating a table that contains multiple records pulled out of the database. I'm building the table myself and passing it to the page since the table needs to be fairly customized (ie, a datagrid isn't going to work). On this page, people can update a variet of records. On submit, I want to then go in and update all of the records. Normally, I'd make each form element include a runat: server and then declare it in my codebhind so I...
2
2857
by: Alexey.Murin | last post by:
The application we are developing uses MS Access 2003 database (with help of ADO). We have noticed that during massive records updating the size of the mdb file increases dramatically (from 3-4 to 200-300 Mb). After compacting the file shrinks back to 3-4 Mb. I have performed the following experiment. I created a test database containing only one table with two columns (Key number, Value text(50)). The table contains 10 thousands...
8
1612
by: mantrid | last post by:
Hello Im having problems working out why the following code does not work. I dont think its the sql as the error occurs on the first update which ever one is put there ($q1 or $q2). Ive swapped then around to test this. Help greatly appreciated The error is Unknown column 'A' in 'field list' but there is no field 'A'. im thinking that the 'A' may be first letter of the word Array, as if it is using this as a variable, but i dont know...
2
1467
by: najimou | last post by:
Hi I have a subform where the user make changes to several filtered records in view. when clicking the updating button, I run the update query to perform some calculations and update the table for only those filtered records. however with an update query, its only updating to the first record in view. any workaround for this problem? much appreciated
14
1613
by: dancer | last post by:
Using ASP.net 1.1 2 QUESTIONS: 1. Why do my write commands not work? 2. This file successfully makes changes in the database record. There surely is some simple code I could add that would *add* records to this database. Who can tell me? <%@ Page Language="VB" Debug="true" %> <%@ Import Namespace="System.Data.Oledb" %>
1
1331
by: hilal84 | last post by:
Hi, I have a problem on updating some records on sql server 2005. I can update the records in the table apart from some records. Records are added to table by a .net application. When I try to update some records on the table (1-2 records ~1500 records) sql server shows "executing query" message but it cannot execute the update query for these records. on the other records updating query works fine. Do you have any idea?
5
2911
by: Bill Schanks | last post by:
I have a winform app (VB 2005) that allows users to export data to excel, make updates to the excel file and import the data from that Excel file and update the database. My question is: Is it best to do it this way, calling the update stored procedure for every update? Or should I be loading this data into a staging table, and if all goes well do the 'Real' Update. Or put this into a data adapter and update from that? The application...
0
9554
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
9377
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
10136
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
9925
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,...
0
9811
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8814
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
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
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2788
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.