I'm trying to use a SELECT query with SqlDataAdapter to fill a dataset, the problem is occurring in this parameters.add line. The SqlConnection is OK.
Dim dt As New DataSet()
Using adapter As New SqlDataAdapter("SELECT * from TAB_Movimentos WHERE Banco = @Banco", New SqlConnection(MontaStringConexaoSQLServer()))
adapter.UpdateCommand.Parameters.Add("@Banco", SqlDbType.Int)
adapter.Fill(dt)
End Using
Returning:
Referência de objeto não definida para uma instância de um objeto." (BR)
Object reference not set to an instance of an object." (EN)