bsr tous le monde ... j ai un probleme avec mon code , cette action ne donne aucune resultat dans la base de donnée et je ne sais pas ou ce trouve le probleme ...
le 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
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
Public Partial Class GestionAdmin
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
 
 
        Dim table As String
 
 
        dr = selectclient()
 
        Application("count_visitor") += 1
        table = "<table border ='1' width='50%'>"
        table &= "<tr> <td>code</td> <td>Nom</td> <td>Adresse</td><td>Ville</td><td>Tele</td><td>Login</td><td>Pass</td><td>Modifier</td><td>Supprimer</td> </tr>"
 
        Try
            If dr.HasRows Then
 
                While dr.Read
                    table &= "<tr>  <td>" & dr(0) & " </td>   <td>" & dr(1) & "</td>   <td>" & dr(2) & "</td>   <td>" & dr(3) & " </td> <td>" & dr(4) & "</td><td>" & dr(5) & " </td><td>" & dr(6) & " </td>    <td><a title ='Supprimer les information de" & dr(1) & "' href='GestionClient.aspx?action=supprimer&id=" & dr(0) & "' >Supprimer</a> </td><td><a title ='modifier les information de" & dr(1) & "' href='GestionClient.aspx?action=modifier&id=" & dr(0) & "'>modifier</a></td></tr>"
 
                End While
            Else
                table &= "<tr>  <td colspan ='7'> n'existe pas </td></tr>"
 
 
            End If
 
            table &= "</table>"
            Label1.Text = table
            dr.Close()
 
        Catch ex As Exception
 
        End Try
 
        ' Label1.Text &= "<br> le nombre de visiteur est " & Application("count_visitor") & "</br>"
        Select Case Request.QueryString("action")
            Case "supprimer"
                If IsNumeric(Request.QueryString("id")) Then
                    removeclient(Request.QueryString("id"))
                    Label2.Text = "le client a été bien suprimer"
                Else
                    Label3.Text = "erreur Fatale"
                End If
                MsgBox("action=" & vbNewLine & "id" & Request.QueryString("id"))
        End Select
 
 
 
 
 
        cn.Close()
 
    End Sub
 
End Class

et à propos les fonctions
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
Public Function removeclient(ByVal id As Integer)
        Return exesql("delete from client where numclient = " & id & "", "w")
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
Imports System.Data.SqlClient
Imports System.Web
Module Modéles
 
 
    Public cn As New SqlConnection("Data Source=OUSSAMA-PC\SQLEXPRESS;Initial Catalog=manager;Integrated Security=True")
    Public cmd As New SqlCommand
    Public dr As SqlDataReader
 
 
 
 
    Public Function exesql(ByVal sql As String, Optional ByVal type As String = "r")
        If cn.State <> ConnectionState.Open Then
            cn.Open()
            cmd.CommandType = CommandType.Text
            cmd.CommandText = sql
            cmd.Connection = cn
            If type = "r" Then
                Return cmd.ExecuteReader
            Else
                Return cmd.ExecuteNonQuery
            End If
            cn.Close()
        End If
 
    End Function
End Module