Bonjour
j'attache un tableau excel vers une datagridview mais dans une colonnes j'ai des cellules en nombre et autre en caractère le problème que il m'attache justement des nombre ou bien des caractère voici mon code

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
        Dim dset As New DataSet
        'Dim Drow As New DataRow
        Dim MyCommand As System.Data.OleDb.OleDbCommand
        Dim MyConnection As System.Data.OleDb.OleDbConnection
        Dim adapter As New OleDb.OleDbDataAdapter
        Dim CmdBuild As New OleDb.OleDbCommandBuilder
        'Dim i As Integer
 
        Try
 
            MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source= " & Me.TextBox1.Text & " ;Extended Properties=Excel 8.0;")
 
            MyCommand = New OleDb.OleDbCommand("select * from [DSA MAROC$]")
 
            adapter.SelectCommand = MyCommand
 
            MyCommand.Connection = MyConnection
 
            adapter.Fill(dset, "table")
 
            Me.DataGridView1.DataSource = dset.Tables("table")
 
        Catch ex As Exception
            MsgBox("Exception :" & ex.Message)
        End Try
Merci d'avance