This is a migrated thread and some comments may be shown as answers.

enterprise library code is not converted properly

1 Answer 41 Views
Code Converter
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nilesh
Top achievements
Rank 1
Nilesh asked on 15 Oct 2010, 10:07 AM
  if (dataAccess.GetType() == typeof(DataAccessLayer.SqlDataAccessLayer))
            {
                param = new System.Data.SqlClient.SqlParameter[size];
                for (int i = 0; i < size; i++)
                    param[i] = new System.Data.SqlClient.SqlParameter();
            }

I want this code in vb.net is any solution any buddy can try and let me know

1 Answer, 1 is accepted

Sort by
0
Todd Anglin
Top achievements
Rank 2
answered on 25 Oct 2010, 11:30 PM
Unfortunately, converting snippets is only as accurate as the snippet context. In this case, there are several variables in the snippet that seem to be defined in another scope. Assuming those variables exist, the output from the Code Converter is mostly correct:

If GetType(dataAccess) = GetType(DataAccessLayer.SqlDataAccessLayer) Then
    param = New System.Data.SqlClient.SqlParameter(size)
    For i As Integer = 0 To size - 1
        param(i) = New System.Data.SqlClient.SqlParameter()
    Next
End If

If you have specific errors, let us know so we can try to help.

-Todd
Tags
Code Converter
Asked by
Nilesh
Top achievements
Rank 1
Answers by
Todd Anglin
Top achievements
Rank 2
Share this question
or