I have an application into which data on horse races is entered, I then click calculate to work out and save the top 3 horses into a seperate database.
I am trying to find the highest value within any column in consecutive groups of 3 rows in a datagrid.
The 3 rows are grouped using a flag in the last column on the 3rd row.
However the following code results in incorrect syntax near = exception.
I hope you can assist, thanks.
I am trying to find the highest value within any column in consecutive groups of 3 rows in a datagrid.
The 3 rows are grouped using a flag in the last column on the 3rd row.
However the following code results in incorrect syntax near = exception.
I hope you can assist, thanks.
VB.NET:
Dim sql As String = "SELECT max(Jockey) FROM VsrData group by EndOfRace = Y "
Try
racetypeda = New SqlDataAdapter(sql, conn)
racetypeda.SelectCommand = New SqlCommand(sql, conn)
builder = New SqlCommandBuilder(racetypeda)
conn.Open()
racetypeds.Clear()
racetypeda.Fill(racetypeds, "VsrData")
VsrDataDataGridView.DataSource = racetypeds.Tables("VsrData")
Catch ex As Exception
MsgBox(ex.ToString.Trim)
End Try
conn.Close()