By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,276 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,276 IT Pros & Developers. It's quick & easy.

OleDbDataReader

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.