enterprise library code is not converted properly

2 posts, 0 answers
  1. Nilesh
    Nilesh avatar
    1 posts
    Member since:
    Oct 2010

    Posted 15 Oct 2010 Link to this post

      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
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 25 Oct 2010 Link to this post

    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
Back to Top