OleDbDataReader

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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,

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"
 
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").ToString)

Loop

conn.Close()



Ken

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

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top