TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
BHAvesh Jodhani
NA
2
9k
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
Reply
Answers (
1
)
A column named '' already belongs to this DataTable.how to s
iteration for this "abc_{yyyyMMdd}_xyz_{HHmmss}" filename.