Imports System.Data.OleDb Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Con As OleDbConnection Dim sqlCmd As OleDbCommand = New OleDbCommand("select * from Movement_roller_H") Dim myData As OleDbDataReader Con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source =C:\Users\Louisa\Desktop\Roller.mdb") Con.Open() sqlCmd.Connection = Con myData = sqlCmd.ExecuteReader Do While myData.Read Dim dgRow As New DataGridViewRow() dgRow.CreateCells(DataGridView1) dgRow.Cells(0).Value = myData.GetInt32(0) dgRow.Cells(1).Value = myData.GetDateTime(1).ToString("d") dgRow.Cells(2).Value = myData.GetString(2) Dim strValue3 As String = IIf(myData.IsDBNull(3), "", myData.GetValue(3)) dgRow.Cells(3).Value = strValue3 dgRow.Cells(4).Value = myData.GetDateTime(4).ToString("d") DataGridView1.Rows.Add(dgRow) Loop End Sub End Class
datagridview1.rows.remove(datagridview1.curentrow)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)