Current location: Hot Scripts Forums » Programming Languages » ASP.NET » ASP .net Problem with MySQL and Realtional Tables


ASP .net Problem with MySQL and Realtional Tables

Reply
  #1 (permalink)  
Old 08-18-04, 04:35 AM
GO4TF4CE's Avatar
GO4TF4CE GO4TF4CE is offline
Wannabe Coder
 
Join Date: Apr 2004
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
ASP .net Problem with MySQL and Realtional Tables

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,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 01:19 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.