Results 1 to 5 of 5

Thread: sql sintax help

  1. #1

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729

    sql sintax help

    Code:
    command2.Parameters.Add("Nicks", nick);
    command2.Parameters.Add("Address", ftp);
    command2.CommandText = "UPDATE T_Users {0} WHERE Index LIKE '" + dr["Index"] + "'";
    I know this is vb.net forum but you should understand it. I'm getting an error that leads me to believe its some sintax problem.

    Any suggestions?
    \m/\m/

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try


    Either this :
    command2.CommandText = "UPDATE T_Users {0} WHERE Index LIKE '" + dr[Index] + "'";

    or this

    command2.CommandText = "UPDATE T_Users {0} WHERE Index LIKE ' + dr[Index] + ' ";

  3. #3

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hmm still the same error

    any ideas?
    \m/\m/

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You don't have any set or parameters in your query.

    VB Code:
    1. command2.CommandText = String.Format("UPDATE T_Users SET  Nicks = @Nick, Address = @Address WHERE Index LIKE '{0}'",dr[Index])
    2. command2.Parameters.Add("@Nicks", nick);
    3. command2.Parameters.Add("@Address", ftp);

  5. #5

    Thread Starter
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    thanks, that was it
    \m/\m/

Posting Permissions

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



Click Here to Expand Forum to Full Width