Trying to set up an insert statement in asp.net.
My insertCommand is as follows:
InsertCommand="INSERT INTO DVD VALUES (DVD_SEQ.NEXTVAL, :DVD_TITLE, :RENTAL_COST, :RATING, :COVER_IMAGE)"
The code for the insert parameters are:
<InsertParameters>
<asp:ControlParameter ControlID="titleBox" DefaultValue="TITLEDEFAULT"
Name="DVD_TITLE" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="rentalBox" DefaultValue="99"
Name="RENTAL_COST" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="ratingList" DefaultValue="25" Name="RATING"
PropertyName="SelectedValue" Type="Int32" />
<asp:Parameter Name="COVER_IMAGE" Type="String" DefaultValue="0.jpg" />
<asp:ControlParameter ControlID="genreList" Name="GENRE_ID"
PropertyName="SelectedValue" />
</InsertParameters>
And my OracleDB table (DVD) which is being inserted into is:
create table dvd
(
dvd_id integer primary key not null,
dvd_title char(100) not null,
rental_cost number(9,2) not null,
rating integer not null,
cover_image char(100),
foreign key(rating) references RATING(rating_id)
);
I'm thinking it's a potential conflict of variable types, as the types for the variables in the parameter section do differ from that in my table but I've tried swapping them around to more fitting types to no avail!