How do I make a new recordset that has nothing to do with a database?

28/04/2006 - 08:39 por Zoo | Informe spam

I have the code written below which runs on VB6 and ADO.
And I want migrate this onto VB.NET 2003 and ADO.NET.

Dim Rs As New ADODB.RecordSet
With Rs
  .Fields.Append "ID", adLongVarChar, 10, adFldRowID
  .Fields.Append "Name", adChar, 50, adFldUpdatable
  .CursorType = adOpenKeyset
  .LockType = adLockOptimistic
End With

Leer las respuestas

#1 Rafael Cruz
04/05/2006 - 17:00 | Informe spam
Hi !
what you could do is use a datatable:

Dim dr As SqlDataReader
Dim dt As DataTable

dt = New DataTable("TableName")
dt.Columns.Add("Id", GetType(Integer))
dt.Columns.Add("Name", GetType(String))

Dim myrow As DataRow
myrow = dt.NewRow
myrow("Id") = 1
myrow("Name") = "Name 1"

I hope it helps you

Preguntas similares