Home/ASP.NET Forums/Data Access/DataSource Controls - SqlDataSource, ObjectDataSource, etc/Need Help with INSERT INTO

Need Help with INSERT INTO RSS

44 replies

Last post May 01, 2010 01:14 AM by Jonny11b

Beware of bugs in the above code; I have only proved it correct, not tried it.
(Donald Knuth)

Visit my blog

Microsoft Community Contributor 2011-12
  • Jonny11b

    Jonny11b

    Member

    2 Points

    23 Posts

    Re: Need Help with INSERT INTO

    Apr 27, 2010 01:58 AM|LINK

    Thank you for your input. As stated in the tread earlier the UserId and RoleId are stored in the database using the data type Unique Identifier. I added the single quotes to the parameters in response to a must declare scalar variable @sUser. If I remove those quotes I assume that the error would come back. Since I am taking the RoleId from the roles table, where its stored as a unique identifier, I also assume that it will need to be formatted the same as the sUser variable to be entered in to the table.

    If I'm answering questions something in the Universe is broken. :)
  • Naom

    Naom

    All-Star

    36004 Points

    7901 Posts

    Re: Need Help with INSERT INTO

    Apr 27, 2010 02:30 AM|LINK

    The parameters should not have single quotes around them! They both must be defined as UniqueIdentifier. 

    Beware of bugs in the above code; I have only proved it correct, not tried it.
    (Donald Knuth)

    Visit my blog

    Microsoft Community Contributor 2011-12
  • Jonny11b

    Jonny11b

    Member

    2 Points

    23 Posts

    Re: Need Help with INSERT INTO

    Apr 27, 2010 05:03 PM|LINK

    OK, I'll give it a try


    If I'm answering questions something in the Universe is broken. :)
  • Prev Next
    1 2345Last

    ‹ Previous Thread|Next Thread ›