IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VB.NET Discussion :

échec de la conversion de la valeur de paramètre d'un string en byte[]


Sujet :

VB.NET

  1. #1
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut échec de la conversion de la valeur de paramètre d'un string en byte[]
    Salut a tous, transfuge d'excel , j'essaye d'adapter un code que j'utilisé sous excel vers visual basic 2010 express mais je bloque avec cette satané erreur.

    échec de la conversion de la valeur de paramètre d'un string en byte[]
    Ce projet est du bénévolat pour un regroupement d'anciens militaires qui pourra servir a d'autres si cela les intéresse.

    je vous poste le code que j'utilise en espérant que quelqu'un puisse m'aider a le résoudre.

    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
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
     
    Imports System.IO
    Imports System.Data.OleDb
    Imports System.Text.RegularExpressions
    Imports System.Diagnostics
    Imports System.Runtime.Serialization
    Imports System.Runtime.Serialization.Formatters.Binary
     
    Friend Class FrmEntry
        Dim Main As New FrmMain
        Public ShowBind As String
        Public FormState As ModGlobal.Form_State
        Private Sub FrmEntry_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
     
            If FormState = Form_State.Add_RecordState Then
                KeyPreview = True
     
                Call ContextMnu()
                Call CapsLock()
                Call regimentItem()
                Me.BSave.Text = "Sauvegarde:"
                Me.Text = "Ajouter Enregistrement:"
                Call ImageSyntax()
     
                Try
                    With OleCn
                        If .State <> ConnectionState.Open Then
                            .ConnectionString = StrConnection()
                            .Open()
                            'Initialized Command...
                            With OleDa
                                .SelectCommand = New OleDbCommand()
                                .SelectCommand.CommandText = "SELECT * FROM [registre]"
                                .SelectCommand.Connection = OleCn
                            End With
     
                            'Insert Command...
                            With OleDa
                                .InsertCommand = New OleDbCommand()
                                .InsertCommand.CommandText = "INSERT INTO [registre] ([ID_Membre] , [Nom] , [prenom] , [Grade] , [regiment] , [entreele] , [contingent] , " & _
                                "[sortiele] , [Mail] , [profession] , [Ville] , [CodePostal] , [Photos_membre] , [observation]) VALUES (@ID_Membre , @Nom , @Prenom , @Grade , @regiment , @entreele , @contingent , " & _
                                "@sortiele , @mail , @profession , @ville , @CodePostal , @photos_membre , @observation)"
     
                                .InsertCommand.Connection = OleCn
                                .InsertCommand.Parameters.Add("@ID_Membre", OleDbType.VarWChar, 50, "ID_Membre")
                                .InsertCommand.Parameters.Add("@Nom", OleDbType.VarWChar, 50, "Nom")
                                .InsertCommand.Parameters.Add("@Prenom", OleDbType.VarWChar, 50, "Prenom")
                                .InsertCommand.Parameters.Add("@Grade", OleDbType.VarWChar, 50, "Grade")
                                .InsertCommand.Parameters.Add("@regiment", OleDbType.VarWChar, 50, "regiment")
                                .InsertCommand.Parameters.Add("@entreele", OleDbType.VarWChar, 50, "entreele")
                                .InsertCommand.Parameters.Add("@contingent", OleDbType.VarWChar, 50, "contingent")
                                .InsertCommand.Parameters.Add("@sortiele", OleDbType.VarWChar, 50, "sortiele")
                                .InsertCommand.Parameters.Add("@mail", OleDbType.VarWChar, 50, "mail")
                                .InsertCommand.Parameters.Add("@profession", OleDbType.VarWChar, 50, "profession")
                                .InsertCommand.Parameters.Add("@ville", OleDbType.VarWChar, 50, "ville")
                                .InsertCommand.Parameters.Add("@CodePostal", OleDbType.VarWChar, 50, "codepostal")
                                .InsertCommand.Parameters.Add("@photos_membre", OleDbType.Binary, 0, "photos_membre")
                                .InsertCommand.Parameters.Add("@observation", OleDbType.VarWChar, 50, "observation")
     
                            End With
     
     
                            With OleDa
                                .UpdateCommand = New OleDbCommand()
                                .UpdateCommand.CommandText = "UPDATE [registre] SET [Nom] = @Nom , [prenom] = @Prenom , [Grade] = @Grade , [regiment] = @regiment , " & _
                                "[entreele] = @entreele , [contingent] = @contingent , [sortiele] = @sortiele , [Mail] = @mail , [profession] = @profession , [Ville] = @ville , [CodePostal] = @CodePostal , [Photos_membre] = @photos_membre , [observation] = @observation WHERE ([ID_Membre] = @ID_Membre_Syntax)"
     
                                .UpdateCommand.Connection = OleCn
                                .UpdateCommand.Parameters.Add("@Nom", OleDbType.VarWChar, 50, "Nom")
                                .UpdateCommand.Parameters.Add("@Prenom", OleDbType.VarWChar, 50, "Prenom")
                                .UpdateCommand.Parameters.Add("@Grade", OleDbType.VarWChar, 50, "Grade")
                                .UpdateCommand.Parameters.Add("@regiment", OleDbType.VarWChar, 50, "regiment")
                                .UpdateCommand.Parameters.Add("@entreele", OleDbType.VarWChar, 50, "entreele")
                                .UpdateCommand.Parameters.Add("@contingent", OleDbType.VarWChar, 50, "contingent")
                                .UpdateCommand.Parameters.Add("@sortiele", OleDbType.VarWChar, 50, "sortiele")
                                .UpdateCommand.Parameters.Add("@mail", OleDbType.VarWChar, 50, "mail")
                                .UpdateCommand.Parameters.Add("@profession", OleDbType.VarWChar, 50, "profession")
                                .UpdateCommand.Parameters.Add("@ville", OleDbType.VarWChar, 50, "ville")
                                .UpdateCommand.Parameters.Add("@CodePostal", OleDbType.VarWChar, 50, "codepostal")
                                .UpdateCommand.Parameters.Add("@photos_membre", OleDbType.Binary, 0, "photos_membre")
                                .UpdateCommand.Parameters.Add("@observation", OleDbType.VarWChar, 50, "observation")
     
     
                                .UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ID_Membre_Syntax", System.Data.OleDb.OleDbType.VarWChar, 50, _
                                                                                           System.Data.ParameterDirection.Input, False, _
                                                                                CType(0, Byte), CType(0, Byte), "ID_Membre", _
                                                                 DataRowVersion.Default, True))
                            End With
     
     
                        End If
                    End With
                Catch ex As Exception
                    MsgBox(ex.Message(), MsgBoxStyle.Critical, "Error...")
                Finally
                    OleCn.Close()
                End Try
                Exit Sub
            End If
     
            If FormState = Form_State.Edit_RecordState Then
                KeyPreview = True
     
                Call ContextMnu()
                Call CapsLock()
                Call regimentItem()
                Me.BSave.Text = "Mise à Jours:"
                Me.Text = "Edition Enregistrement:"
     
                Try
                    With OleCn
                        If .State <> ConnectionState.Open Then
                            .ConnectionString = StrConnection()
                            .Open()
     
                            With OleDa
                                .SelectCommand = New OleDbCommand()
                                .SelectCommand.CommandText = "SELECT * FROM [registre] WHERE (ID_membre = @ID_Membre)"
                                .SelectCommand.Parameters.Add("@ID_Membre", OleDbType.VarChar, 50, "ID_Membre").Value = ShowBind.ToString()
                                .SelectCommand.Connection = OleCn
                            End With
     
     
                            With OleDa
                                .UpdateCommand = New OleDbCommand()
                                .UpdateCommand.CommandText = "UPDATE [registre] SET [ID_Membre] = @ID_Membre , [Nom] = @Nom , [prenom] = @Prenom , [Grade] = @Grade , [regiment] = @regiment , " & _
                                "[entreele] = @entreele , [contingent] = @contingent , [sortiele] = @sortiele , [Mail] = @mail , [profession] = @profession , [Ville] = @ville , [CodePostal] = @CodePostal , [Photos_membre] = @photos_membre , [observation] = @observation WHERE ([ID_Membre] = @ID_Membre_Syntax)"
                                .UpdateCommand.Connection = OleCn
                                .UpdateCommand.Parameters.Add("@ID_Membre", OleDbType.VarWChar, 50, "ID_Membre")
                                .UpdateCommand.Parameters.Add("@Nom", OleDbType.VarWChar, 50, "Nom")
                                .UpdateCommand.Parameters.Add("@Prenom", OleDbType.VarWChar, 50, "Prenom")
                                .UpdateCommand.Parameters.Add("@Grade", OleDbType.VarWChar, 50, "Grade")
                                .UpdateCommand.Parameters.Add("@regiment", OleDbType.VarWChar, 50, "regiment")
                                .UpdateCommand.Parameters.Add("@entreele", OleDbType.VarWChar, 50, "entreele")
                                .UpdateCommand.Parameters.Add("@contingent", OleDbType.VarWChar, 50, "contingent")
                                .UpdateCommand.Parameters.Add("@sortiele", OleDbType.VarWChar, 50, "sortiele")
                                .UpdateCommand.Parameters.Add("@mail", OleDbType.VarWChar, 50, "mail")
                                .UpdateCommand.Parameters.Add("@profession", OleDbType.VarWChar, 50, "profession")
                                .UpdateCommand.Parameters.Add("@ville", OleDbType.VarWChar, 50, "ville")
                                .UpdateCommand.Parameters.Add("@CodePostal", OleDbType.VarWChar, 50, "codepostal")
                                .UpdateCommand.Parameters.Add("@photos_membre", OleDbType.Binary, 0, "photos_membre")
                                .UpdateCommand.Parameters.Add("@observation", OleDbType.VarWChar, 50, "observation")
     
                                .UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("@ID_Membre_Syntax", System.Data.OleDb.OleDbType.VarWChar, 50, _
                                                                                     System.Data.ParameterDirection.Input, False, _
                                                                            CType(0, Byte), CType(0, Byte), "ID_Membre", _
                                                                 DataRowVersion.Original, True))
                            End With
     
     
                            DtaSet2.Clear()
                            OleDa.Fill(DtaSet2, "registre")
                            Me.Identification.DataBindings.Add(New Binding("Text", DtaSet2, "registre.ID_membre", True))
                            Me.TxtNom.DataBindings.Add(New Binding("Text", DtaSet2, "registre.Nom", True))
                            Me.TxtPrenom.DataBindings.Add(New Binding("Text", DtaSet2, "registre.Prenom", True))
                            Me.TxtGrade.DataBindings.Add(New Binding("Text", DtaSet2, "registre.Grade", True))
                            Me.CBRegiment.DataBindings.Add(New Binding("Text", DtaSet2, "registre.regiment", True))
                            Me.DTEntrele.DataBindings.Add(New Binding("Text", DtaSet2, "registre.entreele", True))
                            Me.DTSortiele.DataBindings.Add(New Binding("Text", DtaSet2, "registre.sortiele", True))
                            Me.TxtContingent.DataBindings.Add(New Binding("Text", DtaSet2, "registre.contingent", True))
                            Me.TxtEmail.DataBindings.Add(New Binding("Text", DtaSet2, "registre.mail", True))
                            Me.TxtProfession.DataBindings.Add(New Binding("Text", DtaSet2, "registre.profession", True))
                            Me.TxtVille.DataBindings.Add(New Binding("Text", DtaSet2, "registre.ville", True))
                            Me.TxtCP.DataBindings.Add(New Binding("Text", DtaSet2, "registre.codepostal", True))
                            Me.TxtObservation.DataBindings.Add(New Binding("Text", DtaSet2, "registre.observation", True))
                            Main = FrmMain
                            Me.PicStudent.Image = FrmMain.PictureBox1.Image
                        End If
                    End With
                Catch ex As Exception
                    MsgBox(ex.Message(), MsgBoxStyle.Critical, "Erreur...")
                Finally
                    OleCn.Close()
     
                End Try
                Exit Sub
            End If
     
        End Sub
     
        'Private Function RequiredEntry() As Boolean
        '    If Identification.Text = "" Or TxtNom.Text = "" Or TxtPrenom.Text = "" Or _
        '         TxtGrade.Text = "" Or TxtContingent.Text = "" Or TxtEmail.Text = "" Or TxtProfession.Text = "" Or _
        '            TxtVille.Text = "" Or TxtCP.Text = "" = True Then
        '        MsgBox("Il manque Des informations ....", MsgBoxStyle.Critical, "Attention...")
        '        Return True
        '        Exit Function
        '    End If
        'End Function
     
        Private Sub BSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BSave.Click
     
            Main = FrmMain
            If FormState = Form_State.Add_RecordState Then
                '   If RequiredEntry() = True Then
                ' Return
                ' End If
                Try
     
                    Dim DtaRow As DataRow
     
                    Dim MemStream As New MemoryStream
                    Dim DataPic_Insert As Byte()
     
                    DtaRow = DtaSet.Tables("registre").NewRow
     
                    With DtaRow
                        .Item("ID_Membre") = IIf(Identification.Text = "", System.DBNull.Value, Identification.Text)
                        .Item("Nom") = IIf(TxtNom.Text = "", System.DBNull.Value, TxtNom.Text)
                        .Item("Prenom") = IIf(TxtPrenom.Text = "", System.DBNull.Value, TxtPrenom.Text)
                        .Item("Grade") = IIf(TxtGrade.Text = "", System.DBNull.Value, TxtGrade.Text)
                        .Item("regiment") = IIf(CBRegiment.Text = "", System.DBNull.Value, CBRegiment.Text)
                        .Item("entreele") = IIf(DTEntrele.Text = "", System.DBNull.Value, DTEntrele.Text)
                        .Item("contingent") = IIf(TxtContingent.Text = "", System.DBNull.Value, TxtContingent.Text)
                        .Item("sortiele") = IIf(DTSortiele.Text = "", System.DBNull.Value, DTSortiele.Text)
                        .Item("mail") = IIf(TxtEmail.Text = "", System.DBNull.Value, TxtEmail.Text)
                        .Item("profession") = IIf(TxtProfession.Text = "", System.DBNull.Value, TxtProfession.Text)
                        .Item("ville") = IIf(TxtVille.Text = "", System.DBNull.Value, TxtVille.Text)
                        .Item("codepostal") = IIf(TxtCP.Text = "", System.DBNull.Value, TxtCP.Text)
                        .Item("observation") = IIf(TxtObservation.Text = "", System.DBNull.Value, TxtObservation.Text)
     
                        Me.PicStudent.Image.Save(MemStream, Imaging.ImageFormat.Jpeg)
                        DataPic_Insert = MemStream.GetBuffer()
                        MemStream.Read(DataPic_Insert, 0, MemStream.Length)
     
                        .Item("photos_membre") = DataPic_Insert
                    End With
     
                    DtaSet.Tables("registre").Rows.Add(DtaRow)
     
                    OleDa.Update(DtaSet, "registre")
                    DtaSet.AcceptChanges()
     
     
                    With Main
                        .BindingContext.Item(DtaSet, "registre").Position = Main.BindingContext.Item(DtaSet, "registre").Count - 1
                        Call .Navigation()
                    End With
     
                    MsgBox("Enregistrement Avec Succés...", MsgBoxStyle.Information, "Enregistrement Reussi...")
                    If MsgBox("Ajouter un Nouveau Membre?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Confirmation...") = MsgBoxResult.Yes Then
                        Me.FormState = Form_State.Add_RecordState
                        Call ResetEntry()
                        Identification.Focus()
                        Exit Sub
                    End If
                    Me.Close()
     
                Catch ex As Exception
                    MsgBox(ex.Message(), MsgBoxStyle.Exclamation, "Désolé, impossible de sauvegarder...")
     
     
                    Identification.Focus()
                    Identification.SelectAll()
                    DtaSet.RejectChanges()
                End Try
                Exit Sub
            End If
     
            If FormState = Form_State.Edit_RecordState Then
                '  If RequiredEntry() = True Then
                ' Return
                'End If
                Try
     
                    Dim MemStream As New MemoryStream
                    Dim DataPic_Update As Byte()
     
                    With DtaSet2
                        .Tables("registre").Rows(0).Item("ID_Membre") = IIf(Identification.Text = "", System.DBNull.Value, Identification.Text)
                        .Tables("registre").Rows(0).Item("Nom") = IIf(TxtNom.Text = "", System.DBNull.Value, TxtNom.Text)
                        .Tables("registre").Rows(0).Item("Prenom") = IIf(TxtPrenom.Text = "", System.DBNull.Value, TxtPrenom.Text)
                        .Tables("registre").Rows(0).Item("Grade") = IIf(TxtGrade.Text = "", System.DBNull.Value, TxtGrade.Text)
                        .Tables("registre").Rows(0).Item("regiment") = IIf(CBRegiment.Text = "", System.DBNull.Value, CBRegiment.Text)
                        .Tables("registre").Rows(0).Item("entreele") = IIf(DTEntrele.Text = "", System.DBNull.Value, DTEntrele.Text)
                        .Tables("registre").Rows(0).Item("contingent") = IIf(TxtContingent.Text = "", System.DBNull.Value, TxtContingent.Text)
                        .Tables("registre").Rows(0).Item("sortiele") = IIf(DTSortiele.Text = "", System.DBNull.Value, DTSortiele.Text)
                        .Tables("registre").Rows(0).Item("mail") = IIf(TxtEmail.Text = "", System.DBNull.Value, TxtEmail.Text)
                        .Tables("registre").Rows(0).Item("profession") = IIf(TxtProfession.Text = "", System.DBNull.Value, TxtProfession.Text)
                        .Tables("registre").Rows(0).Item("ville") = IIf(TxtVille.Text = "", System.DBNull.Value, TxtVille.Text)
                        .Tables("registre").Rows(0).Item("codepostal") = IIf(TxtCP.Text = "", System.DBNull.Value, TxtCP.Text)
                        .Tables("registre").Rows(0).Item("observation") = IIf(TxtObservation.Text = "", System.DBNull.Value, TxtObservation.Text)
     
                        Me.PicStudent.Image.Save(MemStream, Imaging.ImageFormat.Jpeg)
                        DataPic_Update = MemStream.GetBuffer()
                        MemStream.Read(DataPic_Update, 0, MemStream.Length)
     
                        .Tables("registre").Rows(0).Item("photos_membre") = DataPic_Update
     
                    End With
     
     
                    BindingContext(DtaSet2, "registre").EndCurrentEdit()
                    If DtaSet2.HasChanges() Then
                        OleDa.Update(DtaSet2, "registre")
                        DtaSet2.AcceptChanges()
                    End If
     
                    With Main
                        With .DgV
                            .SelectedRows(0).Cells(0).Value = Me.Identification.Text
                            .SelectedRows(0).Cells(1).Value = Me.TxtNom.Text
                            .SelectedRows(0).Cells(2).Value = Me.TxtPrenom.Text
                            .SelectedRows(0).Cells(3).Value = Me.TxtGrade.Text
                            .SelectedRows(0).Cells(4).Value = Me.CBRegiment.Text
                            .SelectedRows(0).Cells(5).Value = Me.TxtContingent.Text
                            .SelectedRows(0).Cells(6).Value = Me.DTEntrele.Text
                            .SelectedRows(0).Cells(7).Value = Me.DTSortiele.Text
                            .SelectedRows(0).Cells(8).Value = Me.TxtEmail.Text
                            .SelectedRows(0).Cells(9).Value = Me.TxtProfession.Text
                            .SelectedRows(0).Cells(10).Value = Me.TxtVille.Text
                            .SelectedRows(0).Cells(11).Value = Me.TxtCP.Text
                            .SelectedRows(0).Cells(12).Value = Me.TxtObservation.Text
     
                        End With
                        .PictureBox1.Image = Me.PicStudent.Image
                    End With
     
                    MsgBox("Mise à jours réussie...", MsgBoxStyle.Information, "Enregistrement Mis à jours...")
                Catch ex As Exception
     
                    MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Désolé, impossible de mettre à jours ...")
     
                    Me.Identification.Text = Main.DgV.SelectedRows(0).Cells(0).Value
                End Try
                Exit Sub
            End If
        End Sub
        Private Sub BBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BBrowse.Click
            Dim OpenFile As New OpenFileDialog()
            Try
                With OpenFile
                    .FileName = ""
                    .Title = "Photo:"
                    .Filter = "Image files: (*.jpg)|*.jpg|(*.jpeg)|*.jpeg|(*.png)|*.png|(*.Gif)|*.Gif|(*.bmp)|*.bmp| All Files (*.*)|*.*"
                    If .ShowDialog = Windows.Forms.DialogResult.OK Then
                        Me.PicStudent.Image = System.Drawing.Image.FromFile(.FileName)
     
                    Else
     
                    End If
                End With
            Catch ex As Exception
                MsgBox(ex.Message(), MsgBoxStyle.Critical, "Error...")
            End Try
        End Sub
        Private Sub BStartCamera_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BStartCamera.Click
            FrmCamera.ShowDialog()
        End Sub
        Private Sub BRemove_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BRemove.Click
            Call ImageSyntax()
        End Sub
        Private Sub ImageSyntax()
            Me.PicStudent.Image = System.Drawing.Image.FromFile(My.Application.Info.DirectoryPath & "\ImageSyntax\NoImage.JPG")
        End Sub
        Private Sub regimentItem()
            With CBRegiment
                .Items.Clear()
                .Items.Add("46 éme Régiment d’infanterie")
                .Items.Add("11 ème  Régiment de Chasseurs")
                .Items.Add("110 ème Compagnie de Genie")
                .Items.Add("357 ème Hopital des Armées Louis Pasteur")
                .Items.Add("501 ème EMSH Etablissement Mixte des Subsistances et Habillement")
                .Items.Add("DTCB (Direction des Transports et de la Circulation")
                .Items.Add("GS - Groupement de Service")
                .Items.Add("DTMVF -Direction des Transports Militaires par Voie Ferrée")
                .Items.Add("ESCADRON de SECURITE puis CEG - Compagnie d’élèves Gendarmes")
                .Items.Add("QG (Quartier Général")
                .Items.Add("11 ème Compagnie de Transmissions")
                .Items.Add("BPM 600")
                .Items.Add("BA 165")
                .Items.Add("728 ème Compagnie de Transmissions")
                .Items.Add("GMSH 300")
                .Items.Add("Famille de militaires ayant vecu à Berlin")
     
            End With
        End Sub
        Private Sub CapsLock()
            Me.Identification.CharacterCasing = CharacterCasing.Upper
            Me.TxtNom.CharacterCasing = CharacterCasing.Upper
            Me.TxtPrenom.CharacterCasing = CharacterCasing.Upper
            Me.TxtGrade.CharacterCasing = CharacterCasing.Upper
            Me.TxtContingent.CharacterCasing = CharacterCasing.Upper
            Me.TxtEmail.CharacterCasing = CharacterCasing.Upper
            Me.TxtProfession.CharacterCasing = CharacterCasing.Upper
            Me.TxtVille.CharacterCasing = CharacterCasing.Upper
            Me.TxtCP.CharacterCasing = CharacterCasing.Upper
            Me.TxtObservation.CharacterCasing = CharacterCasing.Upper
        End Sub
        Private Sub ResetEntry()
     
            Call ImageSyntax()
            Me.Identification.Text = ""
            Me.TxtNom.Text = ""
            Me.TxtPrenom.Text = ""
            Me.TxtGrade.Text = ""
            Call regimentItem()
            Me.TxtContingent.Text = ""
            Me.DTEntrele.ResetText()
            Me.DTSortiele.ResetText()
            Me.TxtEmail.Text = ""
            Me.TxtProfession.Text = ""
            Me.TxtVille.Text = ""
            Me.TxtCP.Text = ""
            Me.TxtObservation.Text = ""
     
        End Sub
     
        Private Sub ContextMnu()
            Dim Context As New ContextMenuStrip()
            Me.Identification.ContextMenuStrip = Context
            Me.TxtNom.ContextMenuStrip = Context
            Me.TxtPrenom.ContextMenuStrip = Context
            Me.TxtGrade.ContextMenuStrip = Context
            Me.TxtContingent.ContextMenuStrip = Context
            Me.DTEntrele.ContextMenuStrip = Context
            Me.DTSortiele.ContextMenuStrip = Context
            Me.TxtEmail.ContextMenuStrip = Context
            Me.TxtProfession.ContextMenuStrip = Context
            Me.TxtVille.ContextMenuStrip = Context
            Me.TxtCP.ContextMenuStrip = Context
            Me.TxtObservation.ContextMenuStrip = Context
        End Sub
     
        Private Sub FrmEntry_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
            e.SuppressKeyPress = e.Control
        End Sub
        Private Sub FrmEntry_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
            Me.Dispose()
        End Sub
     
        Private Sub BCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BCancel.Click
            Me.Close()
        End Sub
     
        Private Sub Identification_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Identification.KeyPress
            Dim NotAllowedSpace As String = " "
            Dim NotAllowed As String = "`~!@#$%^&*()-_=+[{[};:'\| <,>.?/"
     
            'Allowed numbers and letters only...
     
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
            If e.KeyChar <> ControlChars.Back Then
                If NotAllowedSpace.IndexOf(e.KeyChar) = False Then
                    e.Handled = True
                    Exit Sub
                End If
            End If
        End Sub
        Private Sub TxtNom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtNom.KeyPress
            Dim NotAllowed As String = "1234567890~`@#$%^&*()_-+={[}]:;'.><?/|\"
     
            'Allowed Letters only
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
     
        Private Sub TxtPrenom_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtPrenom.KeyPress
            Dim NotAllowed As String = "1234567890~`@#$%^&*()_+={[}]:;'.><?/|\"
     
            'Allowed Letters only
     
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
        Private Sub TxtGrade_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtGrade.KeyPress
            Dim NotAllowed As String = "~`@$%^&*+={[}]:;'><?/|\"
            'Allowed letters and numbers
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
        Private Sub TxtContingent_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtContingent.KeyPress
            Dim NotAllowed As String = "~`@$%^&*+={[}]():;'><?|\"
            'Allowed letters and numbers
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
        'Private Sub TxtEmail_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtEmail.KeyPress
        '    Dim NotAllowed As String = "~`$%^&*+={[}]():;'><?/|\"
        '    'Allowed letters and numbers
        '    If e.KeyChar <> ControlChars.Back = True Then
        '        If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
        '            e.Handled = True
        '        End If
        '    End If
        'End Sub
     
        Private Sub TxtEmail_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TxtEmail.Validating
            Dim email As String = TxtEmail.Text
            If EmailAddressCheck(email) = False Then
     
                Dim result As DialogResult _
                = MessageBox.Show("Adresse Email Invalide." & _
                                           " Voulez Vous en entrer une nouvelle?", " Email Addresse Invalide", _
                                           MessageBoxButtons.YesNo, MessageBoxIcon.Error)
                If result = Windows.Forms.DialogResult.Yes Then
                    e.Cancel = True
                End If
     
            End If
     
     
        End Sub
     
     
        Function EmailAddressCheck(ByVal emailAddress As String) As Boolean
            Dim pattern As String = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]" & _
            "*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"
            Dim emailAddressMatch As Match = Regex.Match(emailAddress, pattern)
            If emailAddressMatch.Success Then
                EmailAddressCheck = True
     
            Else
                EmailAddressCheck = False
     
            End If
        End Function
     
        Private Sub TxtProfession_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtProfession.KeyPress
            Dim NotAllowed As String = "~`@$%^&*_+={[}]:;'()>-<?/|\"
     
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
     
        Private Sub TxtVille_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtVille.KeyPress
            Dim NotAllowed As String = "~`@$%^&*+={[}]():;'><?/|\"
            'Allowed letters and numbers
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
     
        Private Sub TxtCP_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtCP.KeyPress
            Dim NotAllowed As String = "~`@$%^&*+={[}]():;'><?/|\"
            'Allowed letters and numbers
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
     
        Private Sub TxtObservation_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtObservation.KeyPress
            Dim NotAllowed As String = "~`@$%^&*+={[}]():;'><?/|\"
            'Allowed(letters And numbers)
            If e.KeyChar <> ControlChars.Back = True Then
                If NotAllowed.IndexOf(e.KeyChar) = -1 = False Then
                    e.Handled = True
                End If
            End If
        End Sub
     
     
    End Class
    la connection avec la bdd se fait bien mais dés que je veux créer un nouveau membre, ca bug avec la fameuse erreur !!! . Je peche dessus depuis 2 jours mais pas moyen de voir ou vient cette erreur que j'ai comprise (il n'arrive pas a convertir un string en byte)

    Merci d'avance pour l'aide.

  2. #2
    Membre expérimenté
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juillet 2005
    Messages
    562
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Distribution

    Informations forums :
    Inscription : Juillet 2005
    Messages : 562
    Points : 1 511
    Points
    1 511
    Par défaut
    Bonjour,

    C'est cool, on a tout ton code et l'exception mais on ne sait pas sur quel ligne tu as cette exception ...
    Bon si j'ai le temps je copie colle ton truc dans un nouveau projet VB.net ... d'ici là si tu peux nous donner la ligne !

    J@ck.
    Pas de réponse par MP, merci.

    Penser au ça fait plaisir

  3. #3
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    oups dsl , je debute en visual basic ( 10 jours a peine)


    Avertissement 5 Conversion implicite de 'Long' en 'Integer'. c:\Users\****\Desktop\****\FrmEntry.vb 223 55
    Avertissement 6 Conversion implicite de 'Integer' en 'Microsoft.VisualBasic.MsgBoxStyle'. c:\Users\****\Desktop\****\FrmEntry.vb 240 57
    Avertissement 7 Conversion implicite de 'Long' en 'Integer'. c:\Users\****\Desktop\****\FrmEntry.vb 285 55
    Avertissement 8 Conversion implicite de 'Object' en 'String'. c:\Users\****\Desktop\****\FrmEntry.vb 323 42
    Avertissement 9 Conversion implicite de 'Boolean' en 'Integer'. c:\Users\****\Desktop\****\FrmEntry.vb 447 53

    Merci encore de votre aide

  4. #4
    Inactif  

    Homme Profil pro
    Développeur .NET
    Inscrit en
    Janvier 2012
    Messages
    4 904
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 67
    Localisation : Canada

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Finance

    Informations forums :
    Inscription : Janvier 2012
    Messages : 4 904
    Points : 10 168
    Points
    10 168
    Billets dans le blog
    36
    Par défaut
    Bonjour,

    Si je me fie juste au dernier message, il semblerait que tu aies:

    Si ce n'est pas directement dans le code, c'est à quelque part dans le MyProject. (Double-clic sur Myproject dans l'explorateur de solutions)

    Option strict dans VB.net, a le même rôle et le même effet que dans VBA. Cela interdit la conversion implicite.

    Si tu remets option strict à Off, cela pourrait marcher. (Faites ce que je dis, pas ce que fais, et gardez option strict à on )

    Pour faire tes conversions, tu peux utiliser les fonctions de VBA (CDbl etc) ou le faire en .net avec les méthodes Parse ou TryParse. Chaque type de données (ou presque) les intègre.
    À ma connaissance, le seul personnage qui a été diagnostiqué comme étant allergique au mot effort. c'est Gaston Lagaffe.

    Ô Saint Excel, Grand Dieu de l'Inutile.

    Excel n'a jamais été, n'est pas et ne sera jamais un SGBD, c'est pour cela que Excel s'appelle Excel et ne s'appelle pas Access junior.

  5. #5
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    hello et merci pour votre aide , j'ai tester l'option strict off , je n'ai plus d'erreur de Conversion implicite mais j'ai toujours cette satanée erreur "échec de la conversion de la valeur de paramètre d'un string en byte[]"
    j'ai cherché un peu partout meme sur les sites de microsoft et pas grand chose en aide dessus !!!

    Merci encore de votre aide , je sais qu'on va y arriver.

  6. #6
    Membre expérimenté
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juillet 2005
    Messages
    562
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Distribution

    Informations forums :
    Inscription : Juillet 2005
    Messages : 562
    Points : 1 511
    Points
    1 511
    Par défaut
    Désolé je suis un chiant , mais on a toujours pas la ligne ou tu as cette exception =>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    échec de la conversion de la valeur de paramètre d'un string en byte[]
    J@ck.
    Pas de réponse par MP, merci.

    Penser au ça fait plaisir

  7. #7
    Membre expérimenté
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Juillet 2005
    Messages
    562
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 41
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Développeur .NET
    Secteur : Distribution

    Informations forums :
    Inscription : Juillet 2005
    Messages : 562
    Points : 1 511
    Points
    1 511
    Par défaut
    J'ai jeté un coup d'oeil vite fait.
    Je dirais que tu as une erreur sur cette ligne (l57 et l80 et autres) =>
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
     .InsertCommand.Parameters.Add("@photos_membre", OleDbType.Binary, 0, "photos_membre")
    En effet tu lui dis que le type est OleDbType.Binary et tu lui donne un string "photos_membre". Si en bdd le champs est un byte[] alors tu dois lui envoyer un byte[] ce que n'est pas "photos_membre", c'est une string.
    Donc commente toutes ces lignes pour faire un test, et voir dans un premier temps ça corrige ton erreur.
    Par la suite on se chargera de récupérer un byte[] depuis un fichier jpeg si tu veux mais dis nous si c'est ok avant et que tu n'as plus d'erreurs.

    J@ck.
    Pas de réponse par MP, merci.

    Penser au ça fait plaisir

  8. #8
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    j'ai fait comme indiqué , j'ai mis en commentaires les lignes, j'ai aussi passé le mode strict j'ai plus d'erreur mais j'en ai deux autres maintenant !!!

    la premiere quand j'essaye de crée un nouveau membre

    je rempli bien toutes les cellules et quand je clique sur sauvegarde j'ai droit a cette erreur

    "Aucune valeur Donnée pour un ou plusieurs parametre requis"

    et la deuxieme si je force la creation d'un utilisateur dans access et que je veux le modifier j'ai cette erreur

    " la reference d'objet n'est pas definie a une instance d'un objet' !!!

    J'explique ma construction de bdd dés fois que je m'y prendrais comme un manche.

    J'ai lancer access , j'ai crée une nouvelle base de donnée avec les noms mais aucune information pour savoir si c'est du string, du binary ? j'y connais rien a access mais dans tous les tutos que j'ai lu ils l'utilise presque tous.

    dans la liste d'erreur y'a NADA !!! aucune erreur

    je poste un screenshoot au cas ou

    Merci a tous pour votre aide.

    Nom : registre.jpg
Affichages : 606
Taille : 148,1 Ko

  9. #9
    Membre expert Avatar de jopopmk
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2011
    Messages
    1 856
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2011
    Messages : 1 856
    Points : 3 570
    Points
    3 570
    Par défaut
    Salut,

    @J@ckHerror : je pense que la fonction Add est celle-ci, et a priori "photos_membre" serait le nom du champ en base.

    Perso je préférerais quand même avoir réellement la ligne où ça déconne plutôt que de chercher en déroulant le code de tête.
    Sinon, j'ai quand même regardé un peu le code et le truc qui me titille c'est la taille pour ledit champ Binary (0).

    As-tu essayé de mettre un bon gros nombre à la place, et de passer le type en VarBinary pour voir ?
    Plus je connais de langages, plus j'aime le C.

  10. #10
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    Salut jopopmk , le probleme c'est qu'il ne me met aucune ligne ou se situe l'erreur a moins que j'ai mal configurer l'editeur pour voir la liste des erreurs ? y'a t'il pas moyen d'avoir un log des erreurs a part la fenetre de liste des erreurs ?

    Merci pour votre aide.Pièce jointe 233429

    je joint mon projet qui vous palera surement plus qu'une image

  11. #11
    Membre expert Avatar de jopopmk
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2011
    Messages
    1 856
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2011
    Messages : 1 856
    Points : 3 570
    Points
    3 570
    Par défaut
    Il me semble que si tu lances ton appli en debug, sans point d'arrêt, VS s'arrêtera à l'endroit où ça coince au moment de l'erreur (ça fonctionne comme ça pour le C).

    Mais du coup t'as tenté de déclarer ton OleDbParameter "photos_membre" comme VarBinary avec une taille énorme ? Ex. (avec 10Mo max) :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
        .InsertCommand.Parameters.Add("@photos_membre", OleDbType.VarBinary, 10485760, "photos_membre")
    PS : normal que y'ait un 's' à la fin de "photo" ? C'est bien un champ BLOB derrière ?
    Plus je connais de langages, plus j'aime le C.

  12. #12
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    Ca marche nickel avec le VarBinary, 10485760, l'enregistrement ce fait nickel

    faut juste que je trouve le moyen de faire une incrementation auto car mettre manuellement un numero d'id ca deconne quand je veux mettre a jours un membre

    Encore merci pour ton aide precieuse j'ai encore du pain sur la planche mais la tu m'a franchement super bien aidé.

  13. #13
    Membre expert Avatar de jopopmk
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Mars 2011
    Messages
    1 856
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Mars 2011
    Messages : 1 856
    Points : 3 570
    Points
    3 570
    Par défaut
    Pour déterminer un nouvel identifiant, ça peut se faire directement dans ta base de données, de différentes manières selon le SGBD derrière (AUTO_INCREMENT pour MySQL et ses forks, TRIGGER+SEQUENCE sous Oracle ...). Quant à l'update, tu ne devrais pas avoir à mettre à jour cet identifiant : il est unique, intemporel et sert de discriminant pour savoir quel enregistrement updater.

    Bonne continuation dans ton projet
    Plus je connais de langages, plus j'aime le C.

  14. #14
    Membre à l'essai
    Homme Profil pro
    Trieur de Moules A Jerusalem
    Inscrit en
    Octobre 2016
    Messages
    12
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Pas de Calais (Nord Pas de Calais)

    Informations professionnelles :
    Activité : Trieur de Moules A Jerusalem

    Informations forums :
    Inscription : Octobre 2016
    Messages : 12
    Points : 11
    Points
    11
    Par défaut
    ok merci encore je vais essayé de faire ca.
    Merci encore pour ton aide super precieuse.

Discussions similaires

  1. [2012] Échec de la conversion de la valeur varchar en type de données int.
    Par djelloharmel dans le forum Développement
    Réponses: 4
    Dernier message: 25/09/2015, 23h56
  2. Conversion d'une valeur numérique
    Par aldama dans le forum Débuter
    Réponses: 3
    Dernier message: 19/02/2008, 20h37
  3. Réponses: 4
    Dernier message: 18/06/2007, 13h54
  4. Réponses: 3
    Dernier message: 04/06/2007, 09h31

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo