Click here to Skip to main content
15,499,046 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: event handler Pin
Member 1356965022-Mar-20 6:48
MemberMember 1356965022-Mar-20 6:48 
GeneralRe: event handler Pin
Richard MacCutchan22-Mar-20 6:52
mveRichard MacCutchan22-Mar-20 6:52 
GeneralRe: event handler Pin
Member 1356965022-Mar-20 6:52
MemberMember 1356965022-Mar-20 6:52 
GeneralRe: event handler Pin
Richard MacCutchan22-Mar-20 6:53
mveRichard MacCutchan22-Mar-20 6:53 
GeneralRe: event handler Pin
Member 1356965022-Mar-20 7:13
MemberMember 1356965022-Mar-20 7:13 
GeneralRe: event handler Pin
Victor Nijegorodov22-Mar-20 1:48
MemberVictor Nijegorodov22-Mar-20 1:48 
QuestionIssue Adding a WebService (WSDL) Pin
Member 1185690418-Mar-20 14:06
MemberMember 1185690418-Mar-20 14:06 
Questionvb.net Pin
ago248616-Mar-20 2:23
Memberago248616-Mar-20 2:23 
j'ai une base de donnée Admin et une autre PersonneActive et je souhaiterais recuperer les info dela table Admin pour l'inserer dans la table PersonneActive mais mon soucis c'est qu'il s'enregistre duex et je ne c'est pourquoi.


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
      Try
          If TxtUser.Text = Nothing Or TxtPassWord.Text = Nothing Then
              MsgBox("Veuillez renseigner tous les champs", MsgBoxStyle.Exclamation)
          Else
              If cnx.State = ConnectionState.Closed Then
                  cnx.Open()
              End If

              'VERIFER LES ENREGISTREMENTS DANS LA BASE DE DONNEE
              'cnx.Open()
              Dim searchQuery As String = "select count(*) from Admin WHERE RefAdmin=? and MotDePasse=?"
              Dim Command As New OleDbCommand(searchQuery, cnx)

              Command.Parameters.AddWithValue("@1", OleDbType.VarChar).Value = TxtUser.Text
              Command.Parameters.AddWithValue("@2", OleDbType.VarChar).Value = TxtPassWord.Text

              Dim count = Convert.ToInt32(Command.ExecuteScalar())

              If (count > 0) Then
                  MsgBox("Mot de passe validé avec succès'" & TxtUser.Text & "'", MsgBoxStyle.Information)
                  'DECLARATION DES VARIABLES
                  Dim motpass, nom, dateactive As String
                  motpass = TxtPassWord.Text
                  nom = TxtUser.Text
                  dateactive = DateAndTime.Now()
                  Dim insert2 As String = "INSERT INTO [PersonneActive] ([MotPasseActive], [NomActive], [DateActive]) VALUES (@motpass, @nom, @dateactive)"
                  Using cmd As New OleDbCommand(insert2, cnx)
                      'cmd.Parameters.AddWithValue("", 1)
                      cmd.Parameters.AddWithValue("@1", OleDbType.VarChar).Value = TxtPassWord.Text
                      cmd.Parameters.AddWithValue("@2", OleDbType.VarChar).Value = TxtUser.Text
                      cmd.Parameters.AddWithValue("@3", OleDbType.VarChar).Value = DateAndTime.Now()
                      'cmd.Parameters.AddWithValue("@confirmotpass", confirmotpass)
                      cmd.ExecuteNonQuery()
                  End Using
                  TxtUser.Text = ""
                  TxtPassWord.Text = ""
                  Me.Hide()
                  Form1.Show()
              Else
                  MsgBox("Problème avec le mot de passe ou Compte intouvable... Veuillez contacter l'administrateur AGO KOUAME BERTRAND", MsgBoxStyle.Critical)
                  TxtUser.Text = ""
                  TxtPassWord.Text = ""
              End If
          End If
          'Dim adapter As New OleDbDataAdapter(Command)
          'Dim ds As New DataSet
          'Dim table As New DataTable
          'adapter.Fill(ds, "CERTIFICAT")
          'DataGridView1.DataSource = ds.Tables("CERTIFICAT")

          'adapter.Dispose()
      Catch ex As Exception
          MsgBox(ex.Message)
      Finally
          cnx.Close()
      End Try
  End Sub

SuggestionRe: vb.net Pin
Richard Deeming16-Mar-20 10:41
mveRichard Deeming16-Mar-20 10:41 
QuestionDeveloping a Restaurant Billing System Pin
Meax10-Mar-20 2:36
MemberMeax10-Mar-20 2:36 
AnswerRe: Developing a Restaurant Billing System Pin
Eddy Vluggen10-Mar-20 3:05
professionalEddy Vluggen10-Mar-20 3:05 
GeneralRe: Developing a Restaurant Billing System Pin
Meax12-Mar-20 1:43
MemberMeax12-Mar-20 1:43 
GeneralRe: Developing a Restaurant Billing System Pin
Richard Deeming12-Mar-20 2:18
mveRichard Deeming12-Mar-20 2:18 
GeneralRe: Developing a Restaurant Billing System Pin
Eddy Vluggen12-Mar-20 2:41
professionalEddy Vluggen12-Mar-20 2:41 
AnswerRe: Developing a Restaurant Billing System Pin
David Mujica11-Mar-20 11:53
MemberDavid Mujica11-Mar-20 11:53 
GeneralRe: Developing a Restaurant Billing System Pin
Meax12-Mar-20 1:43
MemberMeax12-Mar-20 1:43 
GeneralRe: Developing a Restaurant Billing System Pin
Gerry Schmitz15-Mar-20 8:21
mveGerry Schmitz15-Mar-20 8:21 
Questionfile attributes Pin
johnruben9-Mar-20 12:13
Memberjohnruben9-Mar-20 12:13 
AnswerRe: file attributes Pin
Mycroft Holmes9-Mar-20 12:41
professionalMycroft Holmes9-Mar-20 12:41 
AnswerRe: file attributes Pin
Richard MacCutchan9-Mar-20 23:27
mveRichard MacCutchan9-Mar-20 23:27 
QuestionCopying pictures of desktop icons to a WORD file Pin
Member 124319885-Mar-20 4:35
MemberMember 124319885-Mar-20 4:35 
AnswerRe: Copying pictures of desktop icons to a WORD file Pin
Eddy Vluggen6-Mar-20 0:53
professionalEddy Vluggen6-Mar-20 0:53 
QuestionIs VB.Net under-rated? Pin
Chris Nic28-Feb-20 1:07
MemberChris Nic28-Feb-20 1:07 
AnswerRe: Is VB.Net under-rated? Pin
Dave Kreskowiak28-Feb-20 6:22
mveDave Kreskowiak28-Feb-20 6:22 
GeneralRe: Is VB.Net under-rated? Pin
ZurdoDev28-Feb-20 7:46
professionalZurdoDev28-Feb-20 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.