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

28/04/2006 - 08:39 por Zoo | Informe spam
Hi,All.

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
$B!!!!(B.Fields.Append "ID", adLongVarChar, 10, adFldRowID
$B!!!!(B.Fields.Append "Name", adChar, 50, adFldUpdatable
$B!!!!(B.CursorType = adOpenKeyset
$B!!!!(B.LockType = adLockOptimistic
$B!!!!(B.Open
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"
dt.Rows.Add(myrow)


I hope it helps you

Preguntas similares