H
Horst Mayer
Hello,
I have this query:
SQLQuery = "SELECT P.Last_name ,P.first_name, z.Maßnahme,
confirmTasks.made,
confirmTasks.Wann,confirmTasks.Bemerkung,confirmTasks.Erstellt,Pp.id,p.patientID
,Br" & _
" FROM ((patients AS P INNER JOIN nursing AS
PP ON P.patientID = PP.patientID) " & _
" INNER JOIN ToDoTasks AS Z ON (Pp.id =
Z.id)) " & _
" INNER JOIN confirmTasks ON
(confirmTasks.TaskId = Z.TaskId)" & _
" Where confirmTasks.Vom = '" +
dtpDate.Value.Date + "'" & _
" AND confirmTasks.F = 1" & _
" and (confirmTasks.made = 0 or
confirmTasks.made is null)" & _
" AND P.disabled = 0" & _
" and (confirmTasks.Wann IS NULL)" & _
" ORDER BY P.Last_name ,P.first_name"
I let the data apper in a datagridview in this way:
Dim dt As New DataTable
Dim ds As New DataSet
Dim da As SqlDataAdapter
Dim bs As New BindingSource
Dim SQLQuery As String = ""
ds.Tables.Add(dt)
da = New SqlDataAdapter(SQLQuery, CONNECTIONSTRING)
da.Fill(dt)
Dim cb As New SqlCommandBuilder(da)
bs.DataSource = dt
Me.datagridview .DataSource = bs
Now it is unfortunately not possible to update the db through changed data
in the grid, because there are more tables in the query.
Which way to go? There are only 4 fields in one table (confirmTasks) that
should be updated after the user had made the changes clicking in the column
made.
Any ideas?
Horst
I have this query:
SQLQuery = "SELECT P.Last_name ,P.first_name, z.Maßnahme,
confirmTasks.made,
confirmTasks.Wann,confirmTasks.Bemerkung,confirmTasks.Erstellt,Pp.id,p.patientID
,Br" & _
" FROM ((patients AS P INNER JOIN nursing AS
PP ON P.patientID = PP.patientID) " & _
" INNER JOIN ToDoTasks AS Z ON (Pp.id =
Z.id)) " & _
" INNER JOIN confirmTasks ON
(confirmTasks.TaskId = Z.TaskId)" & _
" Where confirmTasks.Vom = '" +
dtpDate.Value.Date + "'" & _
" AND confirmTasks.F = 1" & _
" and (confirmTasks.made = 0 or
confirmTasks.made is null)" & _
" AND P.disabled = 0" & _
" and (confirmTasks.Wann IS NULL)" & _
" ORDER BY P.Last_name ,P.first_name"
I let the data apper in a datagridview in this way:
Dim dt As New DataTable
Dim ds As New DataSet
Dim da As SqlDataAdapter
Dim bs As New BindingSource
Dim SQLQuery As String = ""
ds.Tables.Add(dt)
da = New SqlDataAdapter(SQLQuery, CONNECTIONSTRING)
da.Fill(dt)
Dim cb As New SqlCommandBuilder(da)
bs.DataSource = dt
Me.datagridview .DataSource = bs
Now it is unfortunately not possible to update the db through changed data
in the grid, because there are more tables in the query.
Which way to go? There are only 4 fields in one table (confirmTasks) that
should be updated after the user had made the changes clicking in the column
made.
Any ideas?
Horst