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

OleDbDataReader

I'm currently using .NET version 2003. I want to be able to retrieve records.
How do I do so using the OleDbDataReader? Can I have some codes as an example?
Nov 21 '05 #1
3 1424
Hello Nexus,

Dim Com As New OleDbCommand(SQL ,Con)

Rdr = Com.ExecuteReader()

Where Con is Connection Object & Rdr is Reader Object

Loop through the Rdr to retrive records.

Partha

"Nexus" <Ne***@discussions.microsoft.com> wrote in message news:B2**********************************@microsof t.com...
I'm currently using .NET version 2003. I want to be able to retrieve records.
How do I do so using the OleDbDataReader? Can I have some codes as an example?

Nov 21 '05 #2
Nexus,

You can use the OleDbDataReader, that is for reading unsorted or sorted
rows, row by row from a database.

Beter is normally to take the approach from the dataset/datatables, which
gives you in one set all the information you need to do an action.

Maybe it is better you give us an idea what you want to do, because what you
ask now can you better read in books. In this dotNet newsgroup the books
from David Sceppa and William (Bill) Vaughn are always promoted. They both
are active in the newsgroup "Microsoft.public.dotnet.framework.adonet" when
you want to meet them.

Bill the last times more than David, however David is as well still active
in that.

I hope this helps so far?

Cor

"Nexus"
I'm currently using .NET version 2003. I want to be able to retrieve
records.
How do I do so using the OleDbDataReader? Can I have some codes as an
example?

Nov 21 '05 #3
Hi,
Dim conn As SqlConnection

Dim strConn As String

Dim drCustomer As SqlDataReader

Dim cmd As SqlCommand

Dim cmdOrders As SqlCommand

Dim ds As New DataSet

strConn = "Server = " + Environment.MachineName + ";"

strConn += "Database = NorthWind;"

strConn += "Integrated Security = SSPI;"

conn = New SqlConnection(strConn)

cmd = New SqlCommand("Select * from Customers", conn)

conn.Open()

drCustomer = cmd.ExecuteReader

Do While drCustomer.Read

Trace.WriteLine(drCustomer.Item("CustomerID").ToSt ring)

Loop

conn.Close()

Ken

------------------------------------

"Nexus" <Ne***@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
I'm currently using .NET version 2003. I want to be able to retrieve
records.
How do I do so using the OleDbDataReader? Can I have some codes as an
example?
Nov 21 '05 #4

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

Similar topics

3
by: Buddy | last post by:
Hello, How do I get the number of row retrieved on a SELECT query when using OleDbDataReader? I am using Framework 1.0.
10
by: Dion Heskett | last post by:
I wish to supply the formating as a parameter, I have tried OleDbDataReader but get a null ref. just can't seem to get this to work. I think this has something to do with ExecuteReader. also...
7
by: Smitty | last post by:
I have a function that imports an Excel file into an Access table using SQL. I then close the OleDataReader and the OleDbConnection, then dispose the OleDbCommand, then OleDbConnection. The calling...
1
by: Claudia Fong | last post by:
Hi, I'm using the oleDbDataReader HasRows properties to detect wheter my table contains a record with the parameter below: oleDbConnection1.Close(); objreturnst.Parameters.Value =...
0
by: Steve1 via DotNetMonster.com | last post by:
Hi all, I''ve created an OleDbDataReader that will contain the number of records that the used SQL query will return. I'm then using a while loop to loop while the OleDBDataReader object has...
1
by: Keith | last post by:
Hi, if have this method in a cs file that connections to a database and returns a datareader to my web form. public OleDbDataReader GetDataReader(string theSQL) { theConn = new...
1
by: Steven K | last post by:
Hello, I am using the following code which works. My question is does the OleDbDataReader need to be closed and then re-executed for every control? Is there a more effecient way of doing this...
1
by: Rob Richardson | last post by:
Greetings! I have a database created in MS Access that has some fields containing Currency data. Every time I try to use one of the OleDbDataReader's GetXXX() methods to read it, I get an...
1
by: Jerry Spence1 | last post by:
I have been doing the following is VB.Net 2003: Dim dr1 As OleDbDataReader .....Code here If Not dr1 Is Nothing Then
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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.