bonjour,
oila je dispose du code suivant:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
 
        Dim conn As New OracleConnection(oradb)
        Dim cmd As New OracleCommand
        cmd.Connection = conn
        cmd.CommandText = "SELECT PR_CLIENT FROM COTE.PRETS"
        cmd.CommandType = CommandType.Text
        'Dim LaRequete As String
        Dim sdaRequetes As New OracleDataAdapter
        sdaRequetes.SelectCommand = cmd
        Dim dsRequete As New DataSet
 
        Try
            conn.Open()
            sdaRequetes.Fill(dsRequete, "TOTO")
            conn.Dispose()
        Catch ex As OracleException
 
        End Try
        Dim a As Integer
        'Dim element As New DataTable
        Dim entetePrets As String = readParamSql("enteteprets")
        Dim entete() As String
        entete = Split(entetePrets, ";")
        '**recuperation des données du dataset
        Dim fs As New System.IO.FileStream(Me.TextBoxFichier3D.Text, IO.FileMode.Create, IO.FileAccess.Write)
        Dim sw As New System.IO.StreamWriter(fs)
 
        For a = 0 To dsRequete.Tables(0).Rows.Count - 1
            'MsgBox(dsRequete.Tables("COTE.PRETS").Rows(a).Item("PR_CLIENT"))
 
            For i As Integer = 0 To entete.LongLength - 1 'element.Rows.Count - 1
                sw.Write(dsRequete.Tables("TOTO").Rows(a).Item(entete(i)) & vbCrLf) '.Item("PR_CLIENT"))
 
            Next
        Next
        MsgBox("ok")
et je cherche a faire une classe parametrable a parti de cette fonction
j'ai commence par ca:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Public Class extractOracle
 
    Private strNomFichier As String
    Private strEnteteFichier As String
    Private strSQLOracle As String
    Private strCmdText As String
 
    Public Sub setNomFichier(ByVal param As String)
        strNomFichier = param
    End Sub
    Public Sub setEnteteFichier(ByVal param As String)
        strEnteteFichier = readParamSql(param)
    End Sub
    Public Sub setSQLOracle(ByVal param As String)
        strSQLOracle = param
    End Sub
    Public Sub setCmdText(ByVal param As String)
        strCmdText = param
    End Sub
 
    Public Function extraction()
        Try
 
 
        Catch ex As Exception
 
        End Try
 
    End Function
End Class
esque quelqu'un peut me donner un coup de main??? merci