473,401 Members | 2,125 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,401 software developers and data experts.

weird datagrid..

46
Hi...
I very need yours help. I having a very weird problem. I want to consider the datagrid is empty or not, then if not empty, i want to total up the value. I using datagrid.text <> "" in my code. Overall i have 3datagrids. The program run smoothly at the first 2datagrids. But when reach to the third datagrids, It occurs error "data access error". What is the proint?? Please help me!
Thank you..

Expand|Select|Wrap|Line Numbers
  1. If datagrid1.Text <> "" Then
  2.             Adodc1.Recordset.MoveLast
  3.             Do While (Adodc1.Recordset.BOF <> True)
  4.                 total1 = total1 + Adodc1.Recordset.Fields("Hour")
  5.                 Adodc1.Recordset.MovePrevious
  6.             Loop
  7.                 txt1.Text = total1   'place in a text box
  8.         Else
  9.         End If
  10.  
  11.         If datagrid2.text <> "" Then
  12.             Adodc2.Recordset.MoveLast
  13.             Do While (Adodc2.Recordset.BOF <> True)
  14.                 total2 = total2 + Adodc2.Recordset.Fields("Hour")
  15.                 Adodc2.Recordset.MovePrevious
  16.             Loop
  17.                 txt2.Text = total2
  18.         Else
  19.         End If
  20.  
  21.         If datagrid3.Text <> "" Then
  22.             Adodc3.Recordset.MoveLast
  23.             Do While (Adodc3.Recordset.BOF <> True)
  24.                 total3 = total3 + Adodc3.Recordset.Fields("Hour")
  25.                 Adodc3.Recordset.MovePrevious
  26.             Loop
  27.                 txt3.Text = total3
  28.         Else
  29.         End If
  30.  
  31.  
May 30 '07 #1
0 972

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shannon | last post by:
I am having a very strange issue with my asp.net application. I have created a datagrid which dynamically gets populated from a person choosing a value from a dropdown list and entering a quantity...
0
by: Greenwich Support | last post by:
Hi All, I have a very weird problem which is occurring with a VB.Net app and PostgreSQL 7.3.1. There is a form that has a standard .Net datagrid on it that contains some data from a table in...
0
by: shamila | last post by:
</asp:label><asp:datagrid id="DataGrid3" runat="server" cssclass="DataGrid" showfooter="True" onupdatecommand="DataGrid3_Update"ondeletecommand="DataGrid3_Delete" oneditcommand="DataGrid3_Edit"...
0
by: Alejandro Penate-Diaz | last post by:
I have two pages, each with one datagrid called "DataGrid1". Each DataGrid have a pushbutton implementing DeleteCommand, wich I am uing for a very different purpose tah actualy delete anything....
1
by: BW | last post by:
Hello, I am attempting to to take edited values from a datagrid control and update the underlying database. Problem is that some of the edited values don quite seem to make it to my update sub....
7
by: scorpion53061 | last post by:
This exception occured while running in the development environment. The debugger didnt catch it though it appeared as a message box prompt........does anyone have insight on this? ...
1
by: Marco | last post by:
I'm having some a really weird issue with datagrids. Basically they work fine until you update the data while a cell is selected. If you do that then the old selected cell will remain on the...
1
by: Andy Sutorius via DotNetMonster.com | last post by:
I am getting this error when I compile a VS2005 web project: The name 'dgdANSI835' does not exist in the current context. This web project has been compiling fine. All of a sudden the code behind...
2
by: Flack | last post by:
I have a DataGrid and a DataTable. When my form loads I create the DataTable with the appropriate columns and use it for the DataGrids.DataSource. Later on in my app, I alter the DataTable: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
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...
0
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...

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.