-4

I want to convert this VB6 code into VB.NET code but I'm a newbie in VB.NET.

On Error Resume Next
rsTemp.AddNew
rsTemp!ID_temp = rsKnowledge!ID
rsTemp!fact = rsKnowledge!YESfact
rsTemp.Update
jwb = rsKnowledge!Yes
If Left(answer, 1) = "G" Then
    rsKnowledge.MoveFirst
    rsKnowledge.Find " ID= '" & answer & "' "
    Label1.Caption = rsKnowledge!question
Else
    rsSolution.MoveFirst
    rsSolution.Find " ID_solution= '" & answer & "' "
    frmDiagnose.Label1.Caption = rsSolution!solution
    frmDiagnose.Show vbModal
End If

By the way, that is an expert system code,

Craig W.
  • 17,838
  • 6
  • 49
  • 82
  • 2
    Seems to me like a fairly simple task to convert. What have you tried so far and why did it not work? – David Apr 01 '14 at 13:19
  • im not joking, i said in my post that in newbie in vb.net. pls help – user3485191 Apr 01 '14 at 13:32
  • 1
    Being a newbie in something is no excuse to not even try and instead come here and expect other people to do your job for you. Take a crack at it, post what you get and what problem you have. – Craig W. Apr 01 '14 at 13:46

2 Answers2

4

This is not a trivial undertaking. However your best bet is to read the relevant advice from the source Upgrading Microsoft Visual Basic 6.0 to Microsoft Visual Basic .NET

Good luck.

renick
  • 3,873
  • 2
  • 31
  • 40
1

You don't specify a version of VB.NET but in Visual Studio 2008, once you create a project, there's Tools > Upgrade Visual Basic 6 Code...

If you declare the variables for this piece of code (or include more code in general), and specify Microsoft DAO 3.6 Object Library in the References tab, you'll get a good conversion for this code.

Mark Hurd
  • 10,665
  • 10
  • 68
  • 101