Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1. [Nombres]
  2. Adrian
  3. Alfoso
  4. Saul
  5. Diana
  6. Juan
  7. Ramon
  8.  
  9. Try
  10. RSSelect.Open("SELECT ...", ConnSql3, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockOptimistic)
  11. Dim colcombo As DataGridViewComboBoxColumn = CType(DataGridView1.Columns("ResponsableCortoPlazo"), DataGridViewComboBoxColumn)
  12.  
  13. For i = 1 To RSSelect.RecordCount
  14. colcombo.Items.Add(RSSelect.Fields(0).Value)
  15. RSSelect.MoveNext()
  16. Next
  17. Catch ex As Exception
  18. RSSelect.Close()
  19. MessageBox.Show("Error: " & ex.Message)
  20. End Try
  21. RSSelect.Close()
  22.  
  23. Try
  24. RSBuscar.Open("Select ...", ConnSql3, CursorTypeEnum.adOpenStatic, LockTypeEnum.adLockOptimistic)
  25. If RSBuscar.EOF Then
  26. Me.DataGridView1.Rows.Add()
  27. oMCColBut.Visible = False
  28. RSBuscar.Close()
  29. Else
  30. For i = 1 To RSBuscar.RecordCount
  31.  
  32. DataGridView1.Rows.Add(RSBuscar.Fields(2).Value, RSBuscar.Fields(3).Value, RSBuscar.Fields(5).Value,
  33. RSBuscar.Fields(0).Value, RSBuscar.Fields(6).Value, RSBuscar.Fields(4).Value)
  34. RSBuscar.MoveNext()
  35.  
  36. Next
  37.  
  38. RSBuscar.Close()
  39.  
  40. End If
  41. Catch ex As Exception
  42. MsgBox(ex.Message)
  43. End Try
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement