Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

ASP .NET SQL recordset first record does not show

Posted on 2003-03-17
3
Medium Priority
?
213 Views
Last Modified: 2008-02-01

could you help me here?

i execute a query, but the first record does not show. i can give the source codes if you need it.
0
Comment
Question by:vbDaiZutsuu
3 Comments
 
LVL 4

Expert Comment

by:arthuryeung
ID: 8150632
did you called a Recordset.moveNext by mistake before you access anything in the recordset ?

if not, please post out the source code
0
 

Accepted Solution

by:
Breedj earned 500 total points
ID: 8152409
In .NET movenext is not supported anymore use the method Read() instead:


...
int x;

myConnection.Open();
SqlDataReader result = myCommand.ExecuteReader(CommandBehavior.CloseConnection);

while (result.Read())
{

  x = Convert.ToInt32(result["columnname"]);
}
result.Close();

... etc.
0
 
LVL 58

Expert Comment

by:Gary
ID: 9349699
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer by Breedj

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question