C
Christopher Weaver
The SQL that I'm sending to my server doesn't work unless I run it through
an interactive tool.
I've done this in VS 2003
cmd.CommandText = "SELECT * FROM \"tblTasks\" ORDER BY " + OrderBy;
odbcDA_TaskActivities.SelectCommand = cmd;
MessageBox.Show(cmd.CommandText);
dsTaskActivities.Clear();
odbcDA_TaskActivities.Fill(dsTaskActivities, "Tasks");
The Fill method fails whenever OrderBy contains more than one field. For
example, this works in the ISQL window of my DBMS controller:
SELECT * FROM "tblTasks" ORDER BY "AssignTo", "DueDate", "Category",
"SubCategory"
It is also the exact text shown in the MessageBox.Show window from the line
before the Fill call in my code when OrderBy is set to
"AssignTo", "DueDate", "Category", "SubCategory" .
But I still get a non-specific system error. When I set OrderBy to
"uidTask" or "Description" the Fill call fills the DataSet.
Any ideas on this?
an interactive tool.
I've done this in VS 2003
cmd.CommandText = "SELECT * FROM \"tblTasks\" ORDER BY " + OrderBy;
odbcDA_TaskActivities.SelectCommand = cmd;
MessageBox.Show(cmd.CommandText);
dsTaskActivities.Clear();
odbcDA_TaskActivities.Fill(dsTaskActivities, "Tasks");
The Fill method fails whenever OrderBy contains more than one field. For
example, this works in the ISQL window of my DBMS controller:
SELECT * FROM "tblTasks" ORDER BY "AssignTo", "DueDate", "Category",
"SubCategory"
It is also the exact text shown in the MessageBox.Show window from the line
before the Fill call in my code when OrderBy is set to
"AssignTo", "DueDate", "Category", "SubCategory" .
But I still get a non-specific system error. When I set OrderBy to
"uidTask" or "Description" the Fill call fills the DataSet.
Any ideas on this?