comment faire pour recuperer les donnes de la ligne selectionnée ? je ne sais pas ce que je doit mettrer dans mon evenement double clic
Code: Imports Microsoft.Practices.EnterpriseLibrary.Data Imports System.Data.Common Public Class searchcommune Dim s_pays As String Dim mydata As New DataSet Dim MyCm As CurrencyManager Dim MyCmClient As CurrencyManager Dim myDatabase As Database = DatabaseFactory.CreateDatabase("DW" )
Private Sub searchcommune_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load listetoutcommune() DataGridView1.DataSource = mydata.Tables("commune1" ) End Sub Private Sub listetoutcommune() Try mydata.Tables("commune1" ).Clear() communeBox.DataBindings.Clear() Catch ex As Exception End Try Dim dbcommand2 As DbCommand = myDatabase.GetStoredProcCommand("ListCp2" ) myDatabase.AddInParameter(dbcommand2, "cpays_1", DbType.String, Form1.TextBox4.Text) myDatabase.LoadDataSet(dbcommand2, mydata, "Commune1" ) End Sub
Private Sub DataGridView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.DoubleClick
Marsh Posté le 13-02-2006 à 15:13:04
comment faire pour recuperer les donnes de la ligne selectionnée ?
je ne sais pas ce que je doit mettrer dans mon evenement double clic
Code:
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports System.Data.Common
Public Class searchcommune
Dim s_pays As String
Dim mydata As New DataSet
Dim MyCm As CurrencyManager
Dim MyCmClient As CurrencyManager
Dim myDatabase As Database = DatabaseFactory.CreateDatabase("DW" )
Private Sub searchcommune_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
listetoutcommune()
DataGridView1.DataSource = mydata.Tables("commune1" )
End Sub
Private Sub listetoutcommune()
Try
mydata.Tables("commune1" ).Clear()
communeBox.DataBindings.Clear()
Catch ex As Exception
End Try
Dim dbcommand2 As DbCommand = myDatabase.GetStoredProcCommand("ListCp2" )
myDatabase.AddInParameter(dbcommand2, "cpays_1", DbType.String, Form1.TextBox4.Text)
myDatabase.LoadDataSet(dbcommand2, mydata, "Commune1" )
End Sub
Private Sub DataGridView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles DataGridView1.DoubleClick
Me.Close()
End Sub
End Class