473,385 Members | 1,593 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,385 software developers and data experts.

How to navigate recordset in C#?

I have VC# 2005. I need to use ADODB instead with ADO.NET. I can open a
recordset. however, I can not navigate records in recordset. How can I
navigate records? What is the command line for adorecordset.movenext,
adorecordset,movefirst...etc. Please help me out.
Jun 22 '07 #1
2 4731


The ado.net is only similar to ado in name.

Throw everything (most everything) you know about recordsets in ADODB.

Google this:
http://www.google.com/search?hl=en&q...+DataSet+ADODB
and read about IDataReaders and DataSets.
IDataReader is a forward only "fire hose" way to read data.

DataSet puts all the data in memory at one time.

If you need to move between data, you'll need a dataset.

But its not .MoveFirst , .MoveNext stuff.
Start there, and then ask more specific questions later is my advice.


"Bernard Kim" <Be********@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.com...
I have VC# 2005. I need to use ADODB instead with ADO.NET. I can open a
recordset. however, I can not navigate records in recordset. How can I
navigate records? What is the command line for adorecordset.movenext,
adorecordset,movefirst...etc. Please help me out.

Jun 22 '07 #2
Bernard,

In ADO.NET, you have a datatable, which is pretty much the same as the
recordset. The DataTable exposes the Rows property, which uses a zero-based
index. Given that, you can do this:

for (int index = 0; index < dt.Rows.Count; ++index)
{
// Get the row.
DataRow row = dt.Rows[index];

// Work with the row here.
}

The Rows property returns a DataRowCollection, which implements the
IEnumerable interface, so you can also do this:

foreach (DataRow row in dt.Rows)
{
// Work with the data row.
}
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Bernard Kim" <Be********@discussions.microsoft.comwrote in message
news:5F**********************************@microsof t.com...
>I have VC# 2005. I need to use ADODB instead with ADO.NET. I can open a
recordset. however, I can not navigate records in recordset. How can I
navigate records? What is the command line for adorecordset.movenext,
adorecordset,movefirst...etc. Please help me out.

Jun 22 '07 #3

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

Similar topics

4
by: Tom | last post by:
I want to open a recordset object on an .asp page. When I open the recordset I would like to use a stored procedure that expects a parameter to be passed for the stored procedure. I will then use...
3
by: Vinnie Davidson | last post by:
Hi! I have a detail page that shows one spesific record based on the article ID. I need to make a navigation on this detail page, with "previous article" and "next article" links. So, my...
1
by: Joe Bond | last post by:
Hi. I have a simple MS Access 2000 form in which I enter some customer data. When the address field is entered I need to see if a duplicate record exists. I need to know this *right away* before...
4
by: Ryan | last post by:
Access 2002, Windows XP, 1 Front end MDB, 1 Back end MDB I have a subform which points to a table. Navigating from one record to the next is obviously dead straight forward. However, this seems...
0
by: Husam | last post by:
Hi EveryBody: I got this decleration from msdn documntation which is: object.Navigate( _ url As String, _ _ _ _ )
2
by: Ryan Ramsey | last post by:
I have been chasing this one down for a week and have narrowed it down to a machine issue. I have the following code: webBrowser.Navigate(http://finao.net/post_dkp.php?database=40); Basically...
2
by: samueltilden | last post by:
I started a new job and the version of Visual Studio 2005 that I am now using does not have the Navigate Backward Button nor the Navigate Forward Button in the Standard Toolbar, and they are not...
0
by: beebelbrox | last post by:
Hi, I am new VB programming in Access and I am requesting help with the following code. This code is attached to a form that will display a specific recordset based in information passed to the...
5
by: timnels | last post by:
I have a web browser control that I'd like to point at a HTML file in my installation directory. I am doing something like: string path = Path.GetDirectoryName(...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.