CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: vb to c#

  1. #1
    Join Date
    Nov 2003
    Posts
    47

    vb to c#

    I am not good in c# plz help to change the following code into c# syantaxxxx









    NRecords = oEmployee.NumberOfRecords
    If NRecords > 0 Then
    For I = 1 To NRecords
    With Worksheets(SHEETNAME)
    myColumn = Range(StartCell).Columns.Column
    Application.StatusBar = "Reading employee " & I & " of " & NRecords
    .Cells(myRow, myColumn) = oEmployee.EmployeeID(I)
    myColumn = myColumn + 1
    s = oEmployee.EmployeeLastName(I) & ", " _
    & oEmployee.EmployeeFirstName(I) & " " _
    & oEmployee.EmployeeMiddleInitial(I) & "."
    .Cells(myRow, myColumn) = s
    myColumn = myColumn + 1
    .Cells(myRow, myColumn) = oEmployee.AddressLine1(I)
    .Cells(myRow, myColumn + 1) = oEmployee.SocialSecurityNumber(I)
    .Cells(myRow, myColumn + 2) = oEmployee.Telephone(I)
    .Cells(myRow, myColumn + 3) = YesNo(oEmployee.SalesRep(I))
    myRow = myRow + 1
    s = oEmployee.AddressLine2(I)
    If (s <> "") Then
    .Cells(myRow, myColumn) = s
    myRow = myRow + 1
    End If
    .Cells(myRow, myColumn) = oEmployee.City(I) _
    & ", " & oEmployee.State(I) _
    & " " & oEmployee.Zipcode(I)
    myRow = myRow + 2


    End With
    Next I
    End If
    Application.ScreenUpdating = True
    Status = oEmployee.CloseData
    End If

    Done:
    Set oEmployee = Nothing
    Application.StatusBar = ""

    End Function

    plz help
    faiza

  2. #2
    Join Date
    Jul 2005
    Location
    Sydney, Australia
    Posts
    1,080

    Re: vb to c#

    I suggest a Google search for "VB.NET C# convert" (without quotes) and you will find numerous Web sites that have code converters.

    Edit:
    Mind you, I'd recommend you turn Option Strict On in VB first and fix all the errors that arise from that first.

  3. #3
    Join Date
    Nov 2003
    Posts
    47

    Re: vb to c#

    thanks a lottt
    i get my solution by search
    faiza

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured