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

Preguntas similare

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
Respuesta Responder a este mensaje
#2 Zoo
31/05/2006 - 08:40 | Informe spam
Thank you so much.
It helps me very much.

And I apologize for incorrect posting to spanish discussion group.

"Rafael Cruz" wrote:

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


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida