Re: SQL Confusion in DA.Fill()

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I see your point, but 'tblTasks' is the literal name of the table on the
back end.


"Earl" <brikshoe@xxxxxxxxxxxxxxxxx> wrote in message
news:O4kYRrPXFHA.3996@xxxxxxxxxxxxxxxxxxxxxxx
> Wouldn't it be:
>
> "SELECT * FROM \" + tblTasks + "\ ORDER BY " + OrderBy;
>
> "Christopher Weaver" <we.aver@xxxxxxxxxxx> wrote in message
> news:O0i2FSKXFHA.1044@xxxxxxxxxxxxxxxxxxxxxxx
>> 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?
>>
>
>


.



Relevant Pages

  • Re: SQL Confusion in DA.Fill()
    ... try to change them to brackets ... > The Fill method fails whenever OrderBy contains more than one field. ... this works in the ISQL window of my DBMS controller: ... When I set OrderBy to ...
    (microsoft.public.dotnet.framework.adonet)
  • SQL Confusion in DA.Fill()
    ... odbcDA_TaskActivities.SelectCommand = cmd; ... The Fill method fails whenever OrderBy contains more than one field. ... this works in the ISQL window of my DBMS controller: ... When I set OrderBy to ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL Confusion in DA.Fill()
    ... Thanks for mentioning the profiler. ... >> The Fill method fails whenever OrderBy contains more than one field. ... this works in the ISQL window of my DBMS controller: ... When I set OrderBy to ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: SQL Confusion in DA.Fill()
    ... > an interactive tool. ... > The Fill method fails whenever OrderBy contains more than one field. ... this works in the ISQL window of my DBMS controller: ... When I set OrderBy to ...
    (microsoft.public.dotnet.framework.adonet)
  • dynamic sql in PL/SQL
    ... IN DATE, i_to_date IN DATE, orderBy IN NUMBER DEFAULT 1, all_joined OUT ... clauses of SQL inside the procedure. ... However it ignores the orderBy parameter inside the procedure. ... Do I have to use dynamic SQL here? ...
    (comp.lang.java.databases)