2011-07-20 7 views
6

Estoy intentando agregar un parámetro a un sqlDataAdapter. He intentado usar parameters.add() pero el adaptador no es un sqlCommand. Aquí hay algo de mi código.Agregue el parámetro a dataAdapter.fill()

Private Sub convertToCSV(ByVal SqlQuery As String) 
     Dim Dt As New DataTable() 
     Dim SqlCon As New SqlConnection("Data Source=db;Initial Catalog=productionservicereminder;User Id=id;Password=pass;") 
     Dim Ada As New SqlDataAdapter(SqlQuery, SqlCon) 

     Ada.Fill(Dt) 

    Public Sub excSP(ByVal ReprtID As Integer, ByVal pgid As Integer) 

convertToCSV(sql4) 

End Sub 

Básicamente estoy tratando de hacer algo como esto:

Ada.Parameters.Add(New SqlParameter("@pgid", pgid)) 

Respuesta

Cuestiones relacionadas