SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: sql syntax

  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sql syntax

    i have userid which is the primary key in members and is a foreign key in booking

    i have movieID which is a primary key in movie and a foreign key in booking

    and the rest the values i wanna put in booking table Showing num, credit card, expiry num

    the problem i m having is that the user types there name in a txt box types which then matches the userid with username in memeber and then saves puts userid in booking.

    the same thing for movieid..user picks movie, movie name gets matched to movie id in movie table and then movie id is put in booking table

    and the rest of the values that are in the txt box Showing num, credit card, expiry num get put in booking table as well...! the problem im having is i keep getting wrong syntax..! this the only problem i have and then i ve finished, could neone help me plz plz

  2. #2
    SitePoint Evangelist
    Join Date
    Apr 2005
    Location
    Moscow, Russia
    Posts
    557
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    the problem im having is i keep getting wrong syntax..! this the only problem i have and then i ve finished, could neone help me plz plz
    Hi, you should provide more details on what you are doing and in what SQL queries you get syntax error

  3. #3
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i basically first tried to get the movie id from the filmtable to the bookingtable (do one by one to make sure each works)

    Code:
     sqlCmd = New OleDbCommand("INSERT INTO booking.movieID FROM films LEFT JOIN films WHERE films.movieID=@movie", objConn)
    and i got'System.Data.OleDb.OleDbCommand' cannot be converted to 'String'. Is that any more helpful ..the rest of information on what i m trying to do i provided before, i ve been trying different ways around it last few days but get a syntax error ..and this which is the latest error

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2005
    Location
    UK
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im not an ASP developer at all but Im pretty sure that is an ASP syntax error. I suggest you try asking in a forum more suited to your needs like the ASP or .NET forum.

  5. #5
    Snowboarders die even younger igor.kudela's Avatar
    Join Date
    Feb 2005
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do you pass the variables into the sql statement ?
    the best option here is to open the MS SQL profiler
    and trace the code that is executed on your database
    from there u can see exactly what goes on on the database server
    and any potential sql errors can be traced from there ( all you need to do is copy paset the query into the query analyzer and see if it executes well
    )
    Igor Kudela
    NetPublisher - FREE Customizable .NET CMS

  6. #6
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok cool much appreciated i ll try that...and yeah i know its Asp.net but no one there seems to answer so i thought they may be confused!


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
  •