ado to ado.net convert

Aug 25 2014 1:13 AM
how to convert ado to ado.net in this code
 
 
 
 
Private Sub FillGrid(ByVal strS As String)
Dim cn As ADODB.Connection = getConnection()
Dim iR As Integer = 0
Dim iC As Integer = 0

Dim rs As ADODB.Recordset = New ADODB.Recordset
Dim st As String = "Select IssueDate,CutNo,PNo,Shape,Pcs,Weight,Remark,ID From Issue where GpId=0"
DGV.Rows.Clear()
cn.Open()
rs.Open(strS, cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockPessimistic)
If rs.RecordCount > 0 Then
While iR < rs.RecordCount
While Not rs.EOF
Dim row As New DataGridViewRow
iC = 0
While iC < 7
Dim tCell As New DataGridViewTextBoxCell
tCell.Value = rs.Fields(iC).Value
row.Cells.Add(tCell)
iC = iC + 1
End While
DGV.Rows.Add(row)
DGV.Rows(iR).Cells.Item("clmID").Value = rs.Fields("ID").Value
iR = iR + 1
rs.MoveNext()
End While
End While
End If
cn.Close()
txtRCnt.Text = DGV.RowCount
End Sub 

Answers (1)