Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Code Convert vb6 to vb.net

Code Convert vb6 to vb.net

Scheduled Pinned Locked Moved Visual Basic
csharptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    charleslau2855
    wrote on last edited by
    #1

    hi, Anyone know how to convert the code below for vb6 to vb.net? here is my vb6 source code! Function LoadLR() dbrs.Open "select Badge,Time,Day,InOut From TimeAInfor where InOut='" + CStr("<") + "' and Month='" + CStr(Mid(Combo1(3).Text, 1, 2)) + "' and Year='" + CStr(Mid(Combo1(4).Text, 3, 2)) + "' order by Day", dbsql 'j = 0 For j = 0 To Form3.ListView1(2).ListItems().Count - 1 If dbrs.RecordCount <> 0 Then dbrs.MoveFirst For i = 0 To dbrs.RecordCount - 1 If Form3.ListView1(2).ListItems(j + 1).SubItems(1) = dbrs.Fields(0) Then h = DatePart("h", CStr(dbrs.Fields(1))) h = h * 60 n = DatePart("n", CStr(dbrs.Fields(1))) F = h + n If F < WorkIn Or F = WorkIn Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = "-" Else If Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) <> "-" Then If F > WorkIn Then T = Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) If T = "" Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = (F - WorkIn) Else If (F - WorkIn) < Val(T) Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = (F - WorkIn) End If End If End If End If End If End If dbrs.MoveNext Next For i = 2 To 32 If Not Form3.ListView1(2).ListItems(j + 1).SubItems(i) = "" And Not Form3.ListView1(2).ListItems(j + 1).SubItems(i) = "-" Then totalLR = totalLR + Val(Form3.ListView1(2).ListItems(j + 1).SubItems(i)) End If Next Form3.ListView1(2).ListItems(j + 1).SubItems(33) = totalLR totalLR = 0 End If Next Call CloseTASystem For i = 0 To ListView1(2).ListItems().Count 'MsgBox ListView1(2).ListItems().Count If ListView1(2).ListItems().Count <> 0 The

    H 1 Reply Last reply
    0
    • C charleslau2855

      hi, Anyone know how to convert the code below for vb6 to vb.net? here is my vb6 source code! Function LoadLR() dbrs.Open "select Badge,Time,Day,InOut From TimeAInfor where InOut='" + CStr("<") + "' and Month='" + CStr(Mid(Combo1(3).Text, 1, 2)) + "' and Year='" + CStr(Mid(Combo1(4).Text, 3, 2)) + "' order by Day", dbsql 'j = 0 For j = 0 To Form3.ListView1(2).ListItems().Count - 1 If dbrs.RecordCount <> 0 Then dbrs.MoveFirst For i = 0 To dbrs.RecordCount - 1 If Form3.ListView1(2).ListItems(j + 1).SubItems(1) = dbrs.Fields(0) Then h = DatePart("h", CStr(dbrs.Fields(1))) h = h * 60 n = DatePart("n", CStr(dbrs.Fields(1))) F = h + n If F < WorkIn Or F = WorkIn Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = "-" Else If Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) <> "-" Then If F > WorkIn Then T = Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) If T = "" Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = (F - WorkIn) Else If (F - WorkIn) < Val(T) Then Form3.ListView1(2).ListItems(j + 1).SubItems(dbrs.Fields(2) + 1) = (F - WorkIn) End If End If End If End If End If End If dbrs.MoveNext Next For i = 2 To 32 If Not Form3.ListView1(2).ListItems(j + 1).SubItems(i) = "" And Not Form3.ListView1(2).ListItems(j + 1).SubItems(i) = "-" Then totalLR = totalLR + Val(Form3.ListView1(2).ListItems(j + 1).SubItems(i)) End If Next Form3.ListView1(2).ListItems(j + 1).SubItems(33) = totalLR totalLR = 0 End If Next Call CloseTASystem For i = 0 To ListView1(2).ListItems().Count 'MsgBox ListView1(2).ListItems().Count If ListView1(2).ListItems().Count <> 0 The

      H Offline
      H Offline
      hannesHTG
      wrote on last edited by
      #2

      Do you expect someone to type everything for you ¿ I'll just give advice. If I were you, I would look into ADO.NET, there are plenty samples on google. Retyping this in .NET, won't help much in any case, because .NET uses DataSets, DataAdapters etc. Just my 2 cents.. HTG CodeGuru Article Reviewer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups