Programme écrit en vusal basic .net

Fermé
smilin Messages postés 2 Date d'inscription mercredi 24 avril 2013 Statut Membre Dernière intervention 25 avril 2013 - 24 avril 2013 à 16:49
smilin Messages postés 2 Date d'inscription mercredi 24 avril 2013 Statut Membre Dernière intervention 25 avril 2013 - 25 avril 2013 à 23:44
Bonjour,
je souhaiterais avoir un code pour un bouton rechercher pour une application pharmaceutique sur le logiciel visual basic .net 2010 .et merci d'avance :)
A voir également:

1 réponse

ozone_ Messages postés 1518 Date d'inscription lundi 13 juillet 2009 Statut Membre Dernière intervention 2 juin 2023 478
24 avril 2013 à 22:26
Salut,

Ta question est incompréhensible !
0
smilin Messages postés 2 Date d'inscription mercredi 24 avril 2013 Statut Membre Dernière intervention 25 avril 2013
25 avril 2013 à 23:44
j'ai une probléme dans ma code vb: voila le code du bouton run
Imports System.Data.OleDb
Public Class Form1

Dim conString As String

Dim dr As OleDbDataReader



Private Sub MEDICAMENTSBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.Validate()
Me.MEDICAMENTSBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.MabaseDataSet)
conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\RoyalDvD\Documents\mabase.mdb"
con = New OleDbConnection(conString)
con.Open()


End Sub
Dim con As New OleDb.OleDbConnection
Dim cmd As New OleDb.OleDbCommand
Dim sete As New DataSet
Dim raw As DataRow
Dim tab As New DataTable

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: cette ligne de code charge les données dans la table 'MabaseDataSet.MEDICAMENTS'. Vous pouvez la déplacer ou la supprimer selon vos besoins.
Me.MEDICAMENTSTableAdapter.Fill(Me.MabaseDataSet.MEDICAMENTS)
con.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=C:\Users\RoyalDvD\Documents\Visual Studio 2010\Projects\Gestion pharmaceutique\Gestion pharmaceutique\mabase.mdb"
con.Open()

End Sub

Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tag.TextChanged, tag.TextChanged

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Form2.Show()
Me.Hide()

End Sub

Private Sub MEDICAMENTSDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles MEDICAMENTSDataGridView.CellContentClick

End Sub

Private Sub MEDICAMENTSBindingSource_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MEDICAMENTSBindingSource.CurrentChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnrun.Click
Dim strSql As String = "select * from MEDICAMENTS where _CODEM LIKE '" & Me.tag.Text & "'"
Dim cmd As OleDbCommand = New OleDbCommand(strSql, con)
dr = cmd.ExecuteReader


While (dr.Read())
Try
Me.MEDICAMENTSTableAdapter.FillBycodem(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End While


End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

End Sub

Private Sub FillBycodemToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Me.MEDICAMENTSTableAdapter.FillBycodem(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub FillBycodemToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Me.MEDICAMENTSTableAdapter.FillBycodem(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub FillBycodeToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FillBycodeToolStripButton.Click
Try
Me.MEDICAMENTSTableAdapter.FillBycode(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try

End Sub

Private Sub ToolStripTextBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripTextBox2.Click
Try
Me.MEDICAMENTSTableAdapter.FillBycode(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try
End Sub

Private Sub FillBycodeToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Try
Me.MEDICAMENTSTableAdapter.FillBycode(Me.MabaseDataSet.MEDICAMENTS)
Catch ex As System.Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
End Try



End Sub

Private Sub FillByToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub
End Class

il affiche une erreur au niveau de cette ligne ( dr = cmd.ExecuteReader)
0