search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

how to load events from two database table

Asked by Anonymous
8 years ago.

i have four table which is (Reservation, ReservationRoom )and (Redemption,RedemptionRoom)..both the Reservation and Redemption table have the same attribute but different data.
is it possible to load both table event into the scheduler?
currently i am able to load the scheduler with the Reservation table only.
im doing it like this
private DataTable DbGetEvents(DateTime start, DateTime end)
{
SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM ReservationRoom rr
INNER JOIN Reservation r ON rr.reservationId=r.reservationId
WHERE NOT (([checkOutDate] <= @start) OR ([checkIndate] >= @end))", ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
da.SelectCommand.Parameters.AddWithValue("start", start);
da.SelectCommand.Parameters.AddWithValue("end", end);
DataTable dt = new DataTable();
da.Fill(dt);
return dt;
}

Answer posted by Dan Letecky [DayPilot]
8 years ago.

Create a new SqlDataAdapter for the second table (da2) and call da2.Fill(dt) to add the data to the same DataTable (dt).

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.