I keep getting the following error, this is not due to the code being wrong as I have tested it out on MS SQL Server and it all works
This is the error:
ERROR [42000] [TCX][MyODBC]You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '; SELECT forumref,SUM(forumref) AS totalcategories FROM tbl_cat
This is the code:
Dim ForumConnection As New OdbcConnection("DSN=MSQL_TEST;")
Dim ForumAdapter As New OdbcDataAdapter("SELECT * FROM tbl_forums; SELECT forumref,SUM(forumref) AS totalcategories FROM tbl_categories GROUP BY forumref;", ForumConnection)
Dim ForumDataSet As New DataSet
ForumAdapter.Fill(ForumDataSet)
Dim ForumRelation As DataRelation = ForumDataSet.Relations.Add("Relation", ForumDataSet.Tables(0).Columns("recordid"), ForumDataSet.Tables(1).Columns("forumref"))
DataGrid1.DataSource = ForumDataSet.Tables(0).DefaultView
DataGrid1.DataBind()
Does anyone know how to solve this?, its driving me mental.
cheers,