ciao a tutti
ho creato una tabella dove
vi sono memorizzati i taxi attivi
ed i passegeri collegati ad i vari taxi
i campi sono
conducente [sarebbe il nome taxi]
passegero [sarebbe il nome del passegero]
ora
ho creato un form di statistica con dentro un datagridview
dove vi è la lista di tutti i taxi attivi....
al fianco vorrei inserire il numero dei passegeri per taxi
ma non so la select giusta.....
per inserire i taxi ed i genere ho immesso questo codice
Dim myconn As New OleDbConnection
myconn = connessione db
Try
myconn.Open()
Catch En As Exception
MsgBox(En.ToString)
Exit Sub
End Try
Dim MyOleCmd As OleDbCommand
Dim strSQL As String
strSQL = "SELECT taxi , genere FROM tbtaxi where attivataxi = '" & Trim("si") & "' and statotaxi = '" & Trim("pbl") & "' "
MyOleCmd = New OleDbCommand(strSQL, myconn)
Dim da As New OleDbDataAdapter(MyOleCmd)
Dim tb As New DataTable("Mytable")
da.Fill(tb)
DataGridView1.DataSource = tb
If myconn.State <> Data.ConnectionState.Closed Then
myconn.Close()
End If