B
bazzer
i have a webform which is connecting to a microsoft access database.
the database contains info about dates and times of films showing in
cinemas. im trying to get the times of a certain film from a certain
cinema on a certain date. this is the sql in my data adapter:
SELECT FilmDetails.cinemaID, Shows.showTime, FilmDetails.filmID,
Shows.showDate
FROM (FilmDetails INNER JOIN
Shows ON FilmDetails.filmID = Shows.filmID)
WHERE (FilmDetails.cinemaID = ?) AND (Shows.showTime = ?) AND
(FilmDetails.filmID = ?)
and this is the code on my webform:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Label4.Text = Session("theCinemaName")
Label6.Text = Session("theFilmName")
Label8.Text = Session("theShowDate")
FilmTimesDataSet1.Clear()
OdbcDataAdapter1.SelectCommand.Parameters("cinemaID").Value
= Session("theCinemaID")
OdbcDataAdapter1.SelectCommand.Parameters("filmID").Value =
Session("theFilmID")
OdbcDataAdapter1.SelectCommand.Parameters("showDate").Value
= Session("theShowDate")
OdbcDataAdapter1.Fill(FilmTimesDataSet1)
ListBox1.DataBind()
End If
End Sub
i get an error though from "OdbcDataAdapter1.Fill(FilmTimesDataSet1)":
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.
can anyone give me an idea of how to fix this error or what exactly is
causing it?
the database contains info about dates and times of films showing in
cinemas. im trying to get the times of a certain film from a certain
cinema on a certain date. this is the sql in my data adapter:
SELECT FilmDetails.cinemaID, Shows.showTime, FilmDetails.filmID,
Shows.showDate
FROM (FilmDetails INNER JOIN
Shows ON FilmDetails.filmID = Shows.filmID)
WHERE (FilmDetails.cinemaID = ?) AND (Shows.showTime = ?) AND
(FilmDetails.filmID = ?)
and this is the code on my webform:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Page.IsPostBack Then
Label4.Text = Session("theCinemaName")
Label6.Text = Session("theFilmName")
Label8.Text = Session("theShowDate")
FilmTimesDataSet1.Clear()
OdbcDataAdapter1.SelectCommand.Parameters("cinemaID").Value
= Session("theCinemaID")
OdbcDataAdapter1.SelectCommand.Parameters("filmID").Value =
Session("theFilmID")
OdbcDataAdapter1.SelectCommand.Parameters("showDate").Value
= Session("theShowDate")
OdbcDataAdapter1.Fill(FilmTimesDataSet1)
ListBox1.DataBind()
End If
End Sub
i get an error though from "OdbcDataAdapter1.Fill(FilmTimesDataSet1)":
Failed to enable constraints. One or more rows contain values violating
non-null, unique, or foreign-key constraints.
can anyone give me an idea of how to fix this error or what exactly is
causing it?