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

ADO record set rs.MoveNext only works once...help

Ok,
MoveNext is only moving to the next record once, then it stays on that
record unless I use these (which work just fine) MoveLast MoveFirst
MovePrevious.

private void btnNext_Click(object sender, System.EventArgs e)
{
ErrorLabel.Text = (rs.RecordCount.ToString());
// this code is used to prevent going to EOF
if(rs.RecordCount != 1)
{
if (!rs.EOF)
{
rs.MoveNext();
if (rs.EOF)
{
rs.MovePrevious();
}
PopulateSimpleNavigationForm();
}
}

Is it screwy because it is a WebApp? I can make a WinApp work just
fine with the same code.

Any help is sincerely appreciated.
Thanks,
Trint

Nov 17 '05 #1
3 2395
The big question is, why don't you use ado.net?

--
Miha Markic [MVP C#] - RightHand .NET consulting & development
www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/
SLODUG - Slovene Developer Users Group www.codezone-si.info

"trint" <tr***********@gmail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Ok,
MoveNext is only moving to the next record once, then it stays on that
record unless I use these (which work just fine) MoveLast MoveFirst
MovePrevious.

private void btnNext_Click(object sender, System.EventArgs e)
{
ErrorLabel.Text = (rs.RecordCount.ToString());
// this code is used to prevent going to EOF
if(rs.RecordCount != 1)
{
if (!rs.EOF)
{
rs.MoveNext();
if (rs.EOF)
{
rs.MovePrevious();
}
PopulateSimpleNavigationForm();
}
}

Is it screwy because it is a WebApp? I can make a WinApp work just
fine with the same code.

Any help is sincerely appreciated.
Thanks,
Trint

Nov 17 '05 #2
I only see you using rs.MoveNext once. Did you mean to have

While (!rs.EOF)
instead of

If (!rs.EOF)
?
If you call rs.MoveNext one time, it's going to move 1 time. If you
want it to keep going, you need to keep calling it. Am I missing
something?

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
I fixed it by changing back over (entirely to ado.net).
Thanks everyone.

Nov 17 '05 #4

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

Similar topics

8
by: mark | last post by:
Access2000 How do I write a query that combines the CTC field from each record below into one record? I need to concatenate the CTC field with a separator, like below: ...
1
by: David | last post by:
Hi, I have a continuous form based on a query. Lets say the form displays 6 records. I also have a button against each record which sets a field to Y or N for each record. I am trying to...
20
by: MS | last post by:
Access 97 I want to requery the data being displayed on a form, then I want to return to the record I was in. Why doesn't this code work? Private Sub CmdRefsh_Click()
5
by: trint | last post by:
Ok, Everything connects correctly and loads properly in this WebApplication. I have four buttons and all work correctly except one (the NEXT RECORD button). PREVIOUS, FIRST and LAST all work...
1
by: Trevor Fairchild | last post by:
Hello all - I've been working in VB6 for about a year and now I've moved "up" to VB.NET. I think I would have fewer problems in learning vb.net if I knew nothing about previous versions of vb......
19
by: Genalube | last post by:
I have an application that will produce a Word document based on five separate queries this has required that I create a ADODB connection: 'Create connection to current database Dim Conn As...
6
by: Richard Hollenbeck | last post by:
Thanks to everybody who has helped me to get this thing finally working (somewhat). I got the field names to properly display in the PageHeaderSection, so I won't post the code from that. Now I'm...
1
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which...
3
by: Kosmos | last post by:
Hey ya'll...I can't seem to figure out why I'm getting this error message, but it all started when I added the new line of code with the recSet5.AddNew --- when I ran the first line, the logic worked...
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
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
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,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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
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,...

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.