Professional Web Applications Themes

SQL statement working in SQL Server but not in .aspx.cs page - ASP.NET General

SELECTcourse_schedule. are you missing a blank here or Am I blind. SELECT course_schedule. "Garfield" <com> wrote in message news:phx.gbl...  ScheduleID) ...

  1. #1

    Default Re: SQL statement working in SQL Server but not in .aspx.cs page

    SELECTcourse_schedule. are you missing a blank here or Am I blind.
    SELECT course_schedule.
    "Garfield" <com> wrote in message
    news:phx.gbl... 
    ScheduleID) 


    MS Guest

  2. #2

    Default Re: SQL statement working in SQL Server but not in .aspx.cs page

    Shouldn't
    sqlString
    ="SELECTcourse_schedule.ScheduleID,coursename,star tdate,enddate,ctr FROM
    be
    sqlString
    ="SELECT course_schedule.ScheduleID,coursename,startdate,en ddate,ctr FROM

    Of course, if this was a SP, you would not have this problem... ;)
    --
    ____________________________________
    Bill Vaughn
    MVP, hRD
    www.betav.com
    Please reply only to the newsgroup so that others can benefit.
    This posting is provided "AS IS" with no warranties, and confers no rights.
    __________________________________

    "Garfield" <com> wrote in message
    news:phx.gbl... 
    ScheduleID) 


    William Guest

  3. #3

    Default Re: SQL statement working in SQL Server but not in .aspx.cs page


    "Garfield" <com> wrote in message
    news:phx.gbl... 
    ScheduleID) 

    The problem is in syour sqlString.

    You shouldn't break up and concatenate your queries, it just makes queries
    hard to read and maintain.
    There's no line limit, so just let'er rip.

    Then you always can just cut and paste from Queryyzer to see if there's
    something wrong with your query.

    This query certianly doesn't work in SQLServer. You failed to alias your
    derived table, but this one will

    sqlString = "SELECT course_schedule.ScheduleID, coursename, startdate,
    enddate, ctr FROM course_schedule, (SELECT count(*) as ctr,ScheduleID FROM
    TraineeCourses GROUP BY ScheduleID) courses WHERE course_schedule.ScheduleID
    = TraineeCourses.ScheduleID AND course_schedule.CourseID =
    courses.CourseID";

    David


    David Guest

Similar Threads

  1. logging onto an aspx page on another server
    By MotorcycleIke in forum ASP.NET Web Services
    Replies: 1
    Last Post: October 7th, 10:01 AM
  2. Accessing an .aspx page from server in a DMZ
    By Terry in forum ASP.NET Web Services
    Replies: 0
    Last Post: July 20th, 06:46 PM
  3. Want to Reboot server from ASPX page
    By Terry in forum ASP.NET Security
    Replies: 4
    Last Post: May 25th, 02:23 AM
  4. Replies: 4
    Last Post: August 22nd, 08:42 AM
  5. Print rendered .aspx page to server's printer
    By Robin Dindayal in forum ASP.NET General
    Replies: 1
    Last Post: July 24th, 11:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139