this is my code.
Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
temp = "DaftarGaji"
modPY.LookUp("SELECT * FROM MS_UMR ORDER BY TAHUN", strCONNECT, 0, 1, temp) End Sub
Public Sub LookUp(ByVal strRecordtoSearch As String, ByVal strCONNECT As String, ByVal KeyFieldPos As Short, ByVal ResultFieldPos As Short, Optional ByVal temp As String = "")
frmLookup1.RecordSource(strRecordtoSearch) '.RecordSource = strRecordtoSearch
frmLookup1.strConnection(strCONNECT)
frmLookup1.KeyField(KeyFieldPos)
frmLookup1.FieldtoReturn(ResultFieldPos)
frmLookup1.Text = "Result Collection ..."
frmLookup1.ShowDialog()
End Sub
Public Sub RecordSource(ByVal value As String)
strSQL = value
End Sub
Private Sub Frmlookup1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If strSQL <> Nothing Then
grdDISPLAY.Columns.Clear()
If rs.State = ADODB.ObjectStateEnum.adStateOpen Then rs.Close()
rs.Open(strSQL, adcLEDGER, ADODB.CursorTypeEnum.adOpenKeyset, ADODB.LockTypeEnum.adLockPessimistic)
custDA.Fill(datatable, rs)
grdDISPLAY.DataSource = datatable
grdDISPLAY.Refresh()
End If
End Sub
How can i clear my datagridview. Pleas help me. Thank's