biste, grazie mille il codice gira senza problemi

ho sostituito il metodo Add con AddWithValue.


il risultato è questo:

codice:
Private Sub sRelazioni(ByRef strFile As String)

Dim strTit As String = ""
Dim indTab As Integer = 0   
Dim numRow As Integer = 0
   '
Dim conn As New SqlConnection("DATA SOURCE='(local)';_
           INITIAL CATALOG='master';UID='sa';PWD=''")

   '   ciclo l'array
For indTab = 0 To UBound(ElencoTabelle) - 1

   Dim cmd As New SqlCommand("sp_fkeys", conn)
   cmd.CommandType = CommandType.StoredProcedure

   Dim da As New SqlDataAdapter(cmd)
   cmd.Parameters.AddWithValue("@pktable_name", _
              "'" + ElencoTabelle(indTab) + "'")

   Dim dt As New DataTable
   da.Fill(dt)

   numRow = dt.Rows.Count 
   If numRow > 0 Then

      strTit = ""
      For Each row As DataRow In dt.Rows

          'Ciclo le righe
          If strTit <> ElencoTabelle(indTab) Then
             strTit = "        * " + ElencoTabelle(indTab)
             strFile = vbCrLf + strTit + vbCrLf
          End If
          strFile = strFile + "                   - " _
                    + row("FK_NAME").Value + ", "
          strFile = strFile + row("PKTABLE_NAME").Value + ", "
          strFile = strFile + row("FKTABLE_NAME").Value + ", "
          strFile = strFile + Trim(row("PKCOLUMN_NAME").Value) _
                    + ", "
          strFile = strFile + Trim(row("FKCOLUMN_NAME").Value) _
                    + vbCrLf

      Next

   End If

   dt.Dispose()
   da.Dispose()
   cmd.Dispose()

Next indTab

conn.Dispose()

End Sub
si può evitare di dichiarare il command ogni volta che entro nel ciclo?
io ho provato a metterlo fuori, ma poi si genera questo errore: "arameter '@pktable_name' was supplied multiple times."
se invece lo lascio nel ciclo va bene.

che mi dici?