Page 1090 - IT2
P. 1090

SelectCommand="SELECT [num_groupe] FROM
               [groupe]"></asp:SqlDataSource>
                        <asp:Button ID="Button1" runat="server" Text="ajouter" /
                  </pre>
                   </form>
               </body>
               </html>
               CodeBehind

                 Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs)
               Handles Button1.Click

               Dim ConnectionString As String =
               "server=.\netsdk2;database=ofppt;trusted_connection=true"
                       Dim CommandText As String = "insert into stagiaire values( " &
               TextBox5.Text & " ,'" & TextBox1.Text & "','" & TextBox2.Text & "','" &
               TextBox3.Text & "','" & TextBox4.Text & "'," & DropDownList1.SelectedValue
               & ")"
                       Dim myConnection As New SqlConnection(ConnectionString)
                       Dim myCommand As New SqlCommand(CommandText, myConnection)
                       Try
                           myConnection.Open()

                           myCommand.ExecuteReader()
                           myConnection.Close()
                       Catch ex As Exception
                           MsgBox(ex.Message)
                       End Try
                       Response.Write("ajout effectué")
                 End Sub

               Question-2 : liste des stagiaires par filière (4 pts)

               design

               <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb"
               Inherits="OFPPT._Default" %>
               <html>
               <head runat="server">
                   <title>Untitled Page</title>
               </head>
               <body>
                   <form id="Form2" runat="server">
                       <p>
                           Selection d'une filiere:
                           <asp:DropDownList id="DropDownList1" runat="server"
               AutoPostBack="True"
                               DataSourceID="SqlDataSource1"
               DataTextField="num_filiaire"></asp:DropDownList>
                            
                           </p>

                                                                                                       5/5

                                        www.itlearning-settat.com

                                  Email: admission@itlearning-settat.com

                                                  Tél.:0661077812
   1085   1086   1087   1088   1089   1090   1091   1092   1093   1094   1095