Вы находитесь на странице: 1из 31

DR.

LUIS BOY CHAVIL


Operaciones con DataSet
Operaciones con Tablas de base
Operaciones con controles
enlazados a datos

DR. LUIS BOY CHAVIL


 Es el repositorio de datos desconectado.
 Se encuentra en la memoria del cliente
 Consume mucha memoria debido a que
mantiene cargados todos los datos
 Permite el desplazamiento hacia cualquier
dirección
 Es actualizable

DR. LUIS BOY CHAVIL


DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
 Crear una conexión a un origen de datos
 Dim Cnn as New SqlConnection(Server=…..)
 Crear un objeto DataAdatper
 Dim oDataAdapter as New SqlDataAdapter (“select campos from tabla”, Cnn)
 Crear un objeto DataSet
 Dim oDataSet as New DataSet
 Llenar los Registros
 oDataAdapter.Fill(oDataSet, “Tabla”)
 Crear un objeto DataRow
 Dim oDataRow as DataRow=oDataSet.Tables(0).NewRow
 Llenar los campos del DataRow con los nuevos valores
 oDataRow(0) = valor1
 odataRow(1) = valor2
 Agregar el DataRow a la colección de filas del
DataTable
 oDataSet.Tables(0).Rows.Add(oDataRow)

DR. LUIS BOY CHAVIL


 Crear una conexión a un origen de datos
 Dim Cnn as New SqlConnection(Server=…..)
 Crear un objeto DataAdatper
 Dim oDataAdapter as New SqlDataAdapter (“select campos from tabla”,
Cnn)
 Crear un objeto DataSet
 Dim oDataSet as New DataSet
 Llenar los Registros
 oDataAdapter.Fill(oDataSet, “Tabla”)
 Crear un objeto DataRow que apunte a la fila “n” por
eliminar
 Dim oDataRow as DataRow=oDataSet.Tables(0).Rows(n)
 Eliminar el registro actual
 oDataRow.Delete()

DR. LUIS BOY CHAVIL


 Crear una conexión a un origen de datos
 Dim Cnn as New SqlConnection(Server=…..)
 Crear un objeto DataAdatper
 Dim oDataAdapter as New SqlDataAdapter (“select campos from tabla”, Cnn)
 Crear un objeto DataSet
 Dim oDataSet as New DataSet
 Llenar los Registros
 oDataAdapter.Fill(oDataSet, “Tabla”)
 Crear un objeto DataRow que apunte a la fila “n” por modificar
 Dim oDataRow as DataRow=oDataSet.Tables(0).Rows(n)
 Inicializar la Edición el registro actual
 oDataSet.tables(0).beginInit()
 Actualizar los campos del DataRow
 oDataRow(0) = valor1
 oDataRow(1) = valor2
 Finalizar la Edición el registro actual
 oDataSet.Tables(0).EndInit()
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL
DR. LUIS BOY CHAVIL

Вам также может понравиться